Techniques for decoding or coding images based on multiple intra-prediction modes

ABSTRACT

Aspects include a method, apparatus and computer-readable medium of decoding video or blocks of an image, including receiving a bitstream of the image, deriving, for a block of the image in the bitstream, multiple intra-prediction modes (IPMs) to use in decoding the block, determining, based on the multiple IPMs, a final predictor to use in decoding the block, and decoding the block using the final predictor. Other aspects include method, apparatus and computer-readable medium for similarly encoding video or blocks of an image.

BACKGROUND

The present disclosure relates generally to video coding, and moreparticularly, to video encoding and decoding based on anintra-prediction mode.

SUMMARY

The following presents a simplified summary of one or more aspects inorder to provide a basic understanding of such aspects. This summary isnot an extensive overview of all contemplated aspects, and is intendedto neither identify key or critical elements of all aspects nordelineate the scope of any or all aspects. Its sole purpose is topresent some concepts of one or more aspects in a simplified form as aprelude to the more detailed description that is presented later.

In one aspect, a method for processing video data is provided. Themethod includes constructing, during a conversion between a currentvideo block of a video and a bitstream of the video, at least onetemplate set for the current video block from a plurality ofsub-templates, deriving multiple intra-prediction modes (IPMs) based oncost calculations, determining, based on the multiple IPMs, a finalpredictor of the current video block, and performing the conversionbased on the final predictor, wherein the plurality of sub-templatesincludes a left sub-template, an above sub-template, an above rightsub-template, a left below sub-template, and a left above sub-template.

In another aspect, an apparatus for processing video data comprising aprocessor and a non-transitory memory with instructions thereon areprovided. The instructions upon execution by the processor, cause theprocessor to construct, during a conversion between a current videoblock of a video and a bitstream of the video, at least one template setfor the current video block from a plurality of sub-templates, derivemultiple IPMs based on cost calculations, determine, based on themultiple IPMs, a final predictor of the current video block, and performthe conversion based on the final predictor, wherein the plurality ofsub-templates includes a left sub-template, an above sub-template, anabove right sub-template, a left below sub-template, and a left abovesub-template.

In another aspect, a non-transitory computer-readable recording mediumstoring a bitstream of a video which is generated by a method performedby a video processing apparatus is provided where the method includesconstructing, during a conversion between a current video block of avideo and a bitstream of the video, at least one template set for thecurrent video block from a plurality of sub-templates, deriving multipleIPMs based on cost calculations, determining, based on the multipleIPMs, a final predictor of the current video block, and generating thebitstream from the current block based on the final predictor, whereinthe plurality of sub-templates includes a left sub-template, an abovesub-template, an above right sub-template, a left below sub-template,and a left above sub-template.

In another aspect, a non-transitory computer-readable storage mediumstoring instructions is provided where the instructions cause aprocessor to construct, during a conversion between a current videoblock of a video and a bitstream of the video, at least one template setfor the current video block from a plurality of sub-templates, derivemultiple IPMs based on cost calculations, determine, based on themultiple IPMs, a final predictor of the current video block, and performthe conversion based on the final predictor, wherein the plurality ofsub-templates includes a left sub-template, an above sub-template, anabove right sub-template, a left below sub-template, and a left abovesub-template

To the accomplishment of the foregoing and related ends, the one or moreaspects include the features hereinafter fully described andparticularly pointed out in the claims. The following description andthe annexed drawings set forth in detail some illustrative features ofthe one or more aspects. These features are indicative, however, of buta few of the various ways in which the principles of various aspects maybe employed, and this description is intended to include all suchaspects and their equivalents.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram that illustrates an example of a video codingsystem, in accordance with some aspects of the present disclosure.

FIG. 2 is a block diagram that illustrates a first example of a videoencoder, in accordance with some aspects of the present disclosure.

FIG. 3 is a block diagram that illustrates an example of a videodecoder, in accordance with some aspects of the present disclosure.

FIG. 4 is a block diagram that illustrates a second example of a videoencoder, in accordance with some aspects of the present disclosure.

FIG. 5 is an example of an encoder block diagram of versatile videocoding (VVC) in accordance with some aspects of the present disclosure.

FIG. 6 is a schematic diagram of intra mode coding with 67intra-prediction modes to capture the arbitrary edge directionspresented in natural video in accordance with some aspects of thepresent disclosure.

FIGS. 7 and 8 are reference example diagrams of wide-angularintra-prediction in accordance with some aspects of the presentdisclosure.

FIG. 9 is a diagram of discontinuity in case of directions that exceed45° angle in accordance with some aspects of the present disclosure.

FIG. 10 is a schematic diagram of location of the samples used for thederivation of α and β for the chroma in accordance with some aspects ofthe present disclosure.

FIG. 11 is a schematic diagram of location of the samples used for thederivation of α and β for the luma in accordance with some aspects ofthe present disclosure.

FIGS. 12-15 illustrate examples of reference samples (Rx,−1 and R−1,y)for PDPC applied over various prediction modes in accordance with someaspects of the present disclosure.

FIG. 16 is a diagram of multiple reference line (MRL) intra-predictionused in accordance with aspects of the present disclosure.

FIGS. 17 and 18 are example diagrams and of an intra sub-partitions(ISP) that divides luma intra-predicted blocks vertically orhorizontally into sub-partitions depending on the block size inaccordance with some aspects of the present disclosure.

FIG. 19 is a diagram of a matrix weighted intra-prediction process (MIP)method for VVC in accordance with some aspects of the presentdisclosure.

FIG. 20 is a diagram of a template based intra mode derivation where thetarget denotes the current block (of block size N) for whichintra-prediction mode is to be estimated in accordance with some aspectsof the present disclosure.

FIG. 21 is a diagram of a template of a set of chosen pixels on which agradient analysis may be performed based on intra-prediction modederivation in accordance with some aspects of the present disclosure.

FIG. 22 is a diagram of a convolution of a 3×3 sobel gradient filterwith the template in accordance with aspects of the present disclosure.

FIG. 23 is a schematic diagram of intra mode coding with greater than 67intra-prediction modes to capture the arbitrary edge directionspresented in natural video in accordance with some aspects of thepresent disclosure.

FIG. 24 is a diagram of an example template including a left-abovesub-template in accordance with some aspects of the present disclosure.

FIG. 25 is a diagram of an example template including a leftsub-template and an above sub-template in accordance with some aspectsof the present disclosure.

FIG. 26 is a diagram of an example template including an abovesub-template in accordance with some aspects of the present disclosure.

FIG. 27 is a diagram of an example template including a leftsub-template in accordance with some aspects of the present disclosure.

FIG. 28 is a diagram of an example template including a leftsub-template and a left-below sub-template in accordance with someaspects of the present disclosure.

FIG. 29 is a diagram of an example template including an abovesub-template and a right-above sub-template in accordance with someaspects of the present disclosure.

FIG. 30 is a diagram of an example template including a leftsub-template, a left-below sub-template, an above sub-template, and aright-above sub-template in accordance with some aspects of the presentdisclosure.

FIG. 31 is a diagram of an example template including a left-abovesub-template, a left sub-template, a left-below sub-template, an abovesub-template, and a right-above sub-template in accordance with someaspects of the present disclosure.

FIG. 32 is a diagram of an example template including sub-templates thatare spaced apart from a target block in accordance with some aspects ofthe present disclosure.

FIG. 33 is a diagram of example template-reference samples for atemplate including a left-above sub-template, a left sub-template, andan above sub-template in accordance with some aspects of the presentdisclosure.

FIG. 34 is a diagram of example template-reference samples for atemplate including a left sub-template and an above sub-template inaccordance with some aspects of the present disclosure.

FIG. 35 is a diagram of example template-reference samples for atemplate including an above sub-template in accordance with some aspectsof the present disclosure.

FIG. 36 is a diagram of example template-reference samples for atemplate including a left sub-template in accordance with some aspectsof the present disclosure.

FIG. 37 is a diagram of example template-reference samples with ahorizontal gap for a template including an above sub-template inaccordance with some aspects of the present disclosure.

FIG. 38 is a diagram of example template-reference samples with avertical gap for a template including an above sub-template inaccordance with some aspects of the present disclosure.

FIG. 39 is a diagram of example template-reference samples with avertically shifted portion for a template in accordance with someaspects of the present disclosure.

FIG. 40 is a diagram of example template-reference samples with ahorizontally shifted portion for a template in accordance with someaspects of the present disclosure.

FIG. 41 is a diagram of an example video decoder in accordance with someaspects of the present disclosure.

FIG. 42 is a diagram of an example video encoder in accordance with someaspects of the present disclosure.

FIG. 43 is a flowchart of an example method of encoding or decoding abitstream in accordance with some aspects of the present disclosure.

DETAILED DESCRIPTION

The detailed description set forth below in connection with the appendeddrawings is intended as a description of various configurations and isnot intended to represent the only configurations in which the conceptsdescribed herein may be practiced. The detailed description includesspecific details for the purpose of providing a thorough understandingof various concepts. However, it will be apparent to a person havingordinary skill in the art that these concepts may be practiced withoutthese specific details. In some instances, structures and components areshown in block diagram form in order to avoid obscuring such concepts.

Several aspects of video coding and decoding will now be presented withreference to various apparatus and methods. These apparatus and methodswill be described in the following detailed description and illustratedin the accompanying drawings by various blocks, components, circuits,processes, algorithms, among other examples (collectively referred to as“elements”). These elements may be implemented using electronichardware, computer software, or any combination thereof. Whether suchelements are implemented as hardware or software depends upon theparticular application and design constraints imposed on the overallsystem.

By way of example, an element, or any portion of an element, or anycombination of elements may be implemented as a “processing system” thatincludes one or more processors. Examples of processors includemicroprocessors, microcontrollers, graphics processing units (GPUs),central processing units (CPUs), application processors, digital signalprocessors (DSPs), reduced instruction set computing (RISC) processors,systems on a chip (SoC), baseband processors, field programmable gatearrays (FPGAs), programmable logic devices (PLDs), state machines, gatedlogic, discrete hardware circuits, and other suitable hardwareconfigured to perform the various functionality described throughoutthis disclosure. One or more processors in the processing system mayexecute software. Software shall be construed broadly to meaninstructions, instruction sets, code, code segments, program code,programs, subprograms, software components, applications, softwareapplications, software packages, routines, subroutines, objects,executables, threads of execution, procedures, functions, among otherexamples, whether referred to as software, firmware, middleware,microcode, hardware description language, or otherwise.

Accordingly, in one or more examples, the functions described may beimplemented in hardware, software, or any combination thereof. Ifimplemented in software, the functions may be stored on or encoded asone or more instructions or code on a computer-readable medium.Computer-readable media includes computer storage media. Storage mediamay be any available media that can be accessed by a computer. By way ofexample, and not limitation, such computer-readable media can include arandom-access memory (RAM), a read-only memory (ROM), an electricallyerasable programmable ROM (EEPROM), optical disk storage, magnetic diskstorage, other magnetic storage devices, combinations of theaforementioned types of computer-readable media, or any other mediumthat can be used to store computer executable code in the form ofinstructions or data structures that can be accessed by a computer.

Aspects described herein generally relate to using multipleintra-prediction modes (IPMs) in decoding (or encoding) images. Forexample, video coding technologies, such as high efficiency video coding(HEVC), versatile video coding (VVC), etc., can use IPMs at the encodingside and decoding side to encode/decode each image or frame of a video,such to compress the number of bits in the bitstream, which can providefor efficient storage or transmission of the image or frame, and thusthe video. As described in further detail herein, the IPMs aredetermined or specified per block of an image, where a block can includea portion of the image defined by a subset of coding units CUs orprediction units (PUs) (e.g., N×N CUs or PUs), where each CU or PU canbe a pixel, a chroma, a luma, a collection of such, etc. The IPM is thenused to predict a given block based on reference pixels, chromas, lumas,etc. of a previously decoded block. This can save from storing orcommunicating values for each pixel, chroma, or luma, etc. In currentvideo coding technologies, there are a limited number of conventionalIPMs (e.g., 67 IPMs in VVC).

In accordance with aspects described herein, given a bitstream thatrepresents an image to be displayed, a block of the image can be derivedbased multiple IPMs to use in decoding the block. Based on the multipleconventional IPMs, a final predictor can be determined for predicting acurrent block to be decoded. Using multiple conventional IPMs canfacilitate improved or more accurate decoding (or encoding) of the blockby effectively allowing use of multiple IPMs, which may achieve adifferent final predictor than a conventional IPM. In one example, thefinal predictor can be determined as one of the multiple conventionalIPMs, which may be based on a syntax element signaled in the encoding orin separate assistance information. In another example, the finalpredictor can be determined as a weighted sum of the conventional IPMs,etc.

Additional aspects described herein relate to using the final predictoralong with a most probable mode (MPM) list that can also be used todetermine or signal an IPM based on IPMs previously used in decodingother blocks. For example, in decoding the block, an IPM can bedetermined based on the final predictor and based on the MPM list, whichcan include determining the IPM from the list as the final predictor, oras a conventional IPM (e.g., where the final predictor is not aconventional IPM) based on the MPM list and the final predictor. Inanother aspect, the final predictor can be used in generating the MPMlist to be used in decoding a subsequent block, where the MPM list canbe generated to include the final predictor, to include a conventionalIPM based on the final predictor, etc. In aspects described herein,using multiple IPMs can allow for improved or more accurate encoding ordecoding of blocks of an image (of a video) while providing operabilitywith existing or future video coding technologies.

FIG. 1 is a block diagram that illustrates an example of a video codingsystem 100 that may utilize the techniques of this disclosure. As shownin FIG. 1, video coding system 100 may include a source device 110 and adestination device 120. The source device 110, which may be referred toas a video encoding device, may generate encoded video data. Thedestination device 120, which may be referred to as a video decodingdevice, may decode the encoded video data generated by the source device110. The source device 110 may include a video source 112, a videoencoder 114, and an input/output (I/O) interface 116.

The video source 112 may include a source such as a video capturedevice, an interface to receive video data from a video contentprovider, and/or a computer graphics system for generating video data,or a combination of such sources. The video data may comprise one ormore pictures or images. The terms “picture,” “image,” or “frame” can beused interchangeably throughout to refer to a single image in a streamof images that produce a video. The video encoder 114 encodes the videodata from the video source 112 to generate a bitstream. The bitstreammay include a sequence of bits that form a coded representation of thevideo data. The bitstream may include coded pictures and associateddata. The coded picture is a coded representation of a picture. Theassociated data may include sequence parameter sets, picture parametersets, and other syntax structures. The I/O interface 116 may include amodulator/demodulator (modem) and/or a transmitter, a bus, orsubstantially any mechanism that facilitates transfer of data betweendevices or within a computing device that may include both the sourcedevice 110 and destination device 120 (e.g., where the computing devicestores the encoded video generated using functions of the source device110 for display using functions of the destination device 120). In oneexample, the encoded video data may be transmitted directly todestination device 120 via the I/O interface 116 through the network 130a. The encoded video data may also be stored onto a storagemedium/server 130 b for access by destination device 120.

The destination device 120 may include an I/O interface 126, a videodecoder 124, and a display device 122. The I/O interface 126 may includea receiver and/or a modem, a bus, or substantially any mechanism thatfacilitates transfer of data between devices or within a computingdevice. The I/O interface 126 may acquire encoded video data from thesource device 110 or the storage medium/server 130 b. The video decoder124 may decode the encoded video data. The display device 122 maydisplay the decoded video data to a user. The display device 122 may beintegrated with the destination device 120, or may be external to thedestination device 120 which be configured to interface with an externaldisplay device.

The video encoder 114 and the video decoder 124 may operate according toa video compression standard, such as the HEVC standard, VVC standardand other current and/or further standards.

FIG. 2 is a block diagram illustrating an example of a video encoder200, which may be an example of the video encoder 114 in the system 100illustrated in FIG. 1, in accordance with some aspects of the presentdisclosure.

The video encoder 200 may be configured to perform any or all of thetechniques of this disclosure. In the example of FIG. 2, the videoencoder 200 includes a plurality of functional components. Thetechniques described in this disclosure may be shared among the variouscomponents of the video encoder 200. In some examples, a processor maybe configured to perform any or all of the techniques described in thisdisclosure, including those of video encoder 200.

The functional components of video encoder 200 may include one or moreof a partition unit 201, a prediction unit 202 which may include a modeselect unit 203, a motion estimation unit 204, a motion compensationunit 205 and an intra-prediction unit 206, a residual generation unit207, a transform unit 208, a quantization unit 209, an inversequantization unit 210, an inverse transform unit 211, a reconstructionunit 212, a buffer 213, and an entropy encoding unit 214.

In other examples, the video encoder 200 may include more, fewer, ordifferent functional components. In an example, the prediction unit 202may include an intra block copy (IBC) unit. The IBC unit may performprediction in an IBC mode in which at least one reference picture is apicture where the current video block is located.

Furthermore, some components, such as the motion estimation unit 204 andthe motion compensation unit 205, may be highly integrated, but areseparately represented in the example of FIG. 2 for purposes ofexplanation.

The partition unit 201 may partition a picture into one or more videoblocks. The video encoder 200 and the video decoder 300 may supportvarious video block sizes.

The mode select unit 203 may select one of the coding modes, intra orinter, e.g., based on error results, and provide the resulting intra- orinter-coded block to at least one of a residual generation unit 207 togenerate residual block data and to a reconstruction unit 212 toreconstruct the encoded block for use as a reference picture. In someexamples, the mode select unit 203 may select a combination of intra-and inter-prediction (CIIP) mode in which the prediction is based on aninter-prediction signal and an intra-prediction signal. The mode selectunit 203 may also select a resolution for a motion vector (e.g., asub-pixel or integer pixel precision) for the block in the case ofinter-prediction.

To perform inter-prediction on a current video block, the motionestimation unit 204 may generate motion information for the currentvideo block by comparing one or more reference frames from buffer 213 tothe current video block. In an example, each reference frame cancorrespond to a picture of the video. The motion compensation unit 205may determine a predicted video block for the current video block basedon the motion information and decoded samples of pictures from thebuffer 213 other than the picture associated with the current videoblock.

The motion estimation unit 204 and the motion compensation unit 205 mayperform different operations for a current video block, for example,depending on whether the current video block is in an I-slice, aP-slice, or a B-slice. As used herein, in some aspects, an “I-slice” mayrefer to a portion of a picture composed of macroblocks, all of whichare based upon macroblocks within the same picture. Further, as usedherein, in some aspects, “P-slices” and “B-slices” may refer to portionsof a picture composed of macroblocks that are not dependent onmacroblocks in the same picture.

In some examples, the motion estimation unit 204 may performuni-directional prediction for the current video block, and the motionestimation unit 204 may search reference pictures of list 0 or list 1for a reference video block for the current video block. The motionestimation unit 204 may then generate a reference index that indicatesthe reference picture in list 0 or list 1 that contains the referencevideo block and a motion vector that indicates a spatial displacementbetween the current video block and the reference video block. Themotion estimation unit 204 may output the reference index, a predictiondirection indicator, and the motion vector as the motion information ofthe current video block. The motion compensation unit 205 may generatethe predicted video block of the current block based on the referencevideo block indicated by the motion information of the current videoblock.

In other examples, the motion estimation unit 204 may performbi-directional prediction for the current video block, where the motionestimation unit 204 may search the reference pictures in list 0 for areference video block for the current video block and may also searchthe reference pictures in list 1 for another reference video block forthe current video block. The motion estimation unit 204 may thengenerate reference indexes that indicate the reference pictures in list0 and list 1 containing the reference video blocks and motion vectorsthat indicate spatial displacements between the reference video blocksand the current video block. The motion estimation unit 204 may outputthe reference indexes and the motion vectors of the current video blockas the motion information of the current video block. The motioncompensation unit 205 may generate the predicted video block of thecurrent video block based on the reference video blocks indicated by themotion information of the current video block.

In some examples, the motion estimation unit 204 may output a full setof motion information for decoding processing of a decoder.

In some examples, the motion estimation unit 204 may not output a fullset of motion information for the current video. Rather, the motionestimation unit 204 may signal the motion information of the currentvideo block with reference to the motion information of another videoblock. For example, the motion estimation unit 204 may determine thatthe motion information of the current video block is sufficientlysimilar to the motion information of a neighboring video block.

In one example, the motion estimation unit 204 may indicate, in a syntaxstructure associated with the current video block, a value thatindicates to the video decoder 300 that the current video block has thesame motion information as the another video block.

In another example, the motion estimation unit 204 may identify, in asyntax structure associated with the current video block, another videoblock and a motion vector difference (MVD). The motion vector differenceindicates a difference between the motion vector of the current videoblock and the motion vector of the indicated video block. The videodecoder 300 may use the motion vector of the indicated video block andthe motion vector difference to determine the motion vector of thecurrent video block.

As discussed above, video encoder 200 may predictively signal the motionvector. Two examples of predictive signaling techniques that may beimplemented by video encoder 200 include advanced motion vectorprediction (AMVP) and merge mode signaling.

The intra-prediction unit 206 may perform intra-prediction on thecurrent video block. When the intra-prediction unit 206 performsintra-prediction on the current video block, the intra-prediction unit206 may generate prediction data for the current video block based ondecoded samples of other video blocks in the same picture. Theprediction data for the current video block may include at least one ofa predicted video block or one or more syntax elements.

The residual generation unit 207 may generate residual data for thecurrent video block by subtracting (e.g., indicated by the minus sign)the predicted video block(s) of the current video block from the currentvideo block. The residual data of the current video block may includeresidual video blocks that correspond to different sample components ofthe samples in the current video block.

In other examples, there may be no residual data for the current videoblock for the current video block, for example in a skip mode, and theresidual generation unit 207 may not perform the subtracting operation.

The transform unit 208, which may also be referred to as a transformprocessing unit, may generate one or more transform coefficient videoblocks for the current video block by applying one or more transforms toa residual video block associated with the current video block.

After the transform unit 208 generates a transform coefficient videoblock associated with the current video block, the quantization unit 209may quantize the transform coefficient video block associated with thecurrent video block based on one or more quantization parameter (QP)values associated with the current video block.

The inverse quantization unit 210 and the inverse transform unit 211 mayapply inverse quantization and inverse transforms to the transformcoefficient video block, respectively, to reconstruct a residual videoblock from the transform coefficient video block. The reconstructionunit 212 may add the reconstructed residual video block to correspondingsamples from one or more predicted video blocks generated by theprediction unit 202 to produce a reconstructed video block associatedwith the current block for storage in the buffer 213.

After the reconstruction unit 212 reconstructs the video block, loopfiltering operation may be performed to reduce video blocking artifactsin the video block.

The entropy encoding unit 214 may receive data from other functionalcomponents of the video encoder 200. When entropy encoding unit 214receives the data, entropy encoding unit 214 may perform one or moreentropy encoding operations to generate entropy encoded data and outputa bitstream that includes the entropy encoded data.

FIG. 3 is a block diagram illustrating an example of video decoder 300,which may be an example of the video decoder 124 in the system 100illustrated in FIG. 1, in accordance with some aspects of the presentdisclosure.

The video decoder 300 may be configured to perform any or all of thetechniques of this disclosure. In the example of FIG. 3, the videodecoder 300 includes a plurality of functional components. Thetechniques described in this disclosure may be shared among the variouscomponents of the video decoder 300. In some examples, a processor maybe configured to perform any or all of the techniques described in thisdisclosure, including those of video decoder 300.

In the example of FIG. 3, the video decoder 300 includes one or more ofan entropy decoding unit 301, a motion compensation unit 302, anintra-prediction unit 303, an inverse quantization unit 304, an inversetransform unit 305, a reconstruction unit 306, and a buffer 307. Thevideo decoder 300 may, in some examples, perform a decoding passgenerally reciprocal to the encoding pass described with respect tovideo encoder 200 (FIG. 2).

The video decoder 300 may receive, via the entropy decoding unit 301 orotherwise, an encoded bitstream. The encoded bitstream may includeentropy coded video data (e.g., encoded blocks of video data). In thisexample, the entropy decoding unit 301 may decode the entropy codedvideo data. Based on the decoded video data, whether entropy decoded orotherwise, the motion compensation unit 302 may determine motioninformation including motion vectors, motion vector precision, referencepicture list indexes, and other motion information. The motioncompensation unit 302 may, for example, determine such information byperforming the AMVP and merge mode. AMVP may be used, includingderivation of several most probable candidates based on data fromadjacent PBs and the reference picture. Motion information typicallyincludes the horizontal and vertical motion vector displacement values,one or two reference picture indices, and, in the case of predictionregions in B slices, an identification of which reference picture listis associated with each index. As used herein, in some aspects, a “mergemode” may refer to deriving the motion information from spatially ortemporally neighboring blocks.

The motion compensation unit 302 may produce motion compensated blocks,possibly performing interpolation based on interpolation filters.Identifiers for interpolation filters to be used with sub-pixelprecision may be included in syntax elements received with the encodedbitstream or in separate assistance information, e.g., as specified by avideo encoder when encoding the video.

The motion compensation unit 302 may use interpolation filters as usedby video encoder 200 during encoding of the video block to calculateinterpolated values for sub-integer pixels of a reference block. Themotion compensation unit 302 may determine the interpolation filtersused by video encoder 200 according to received syntax information anduse the interpolation filters to produce predictive blocks.

The motion compensation unit 302 may use some of the syntax informationto determine sizes of blocks used to encode frame(s) and/or slice(s) ofthe encoded video sequence, partition information that describes howeach macroblock of a picture of the encoded video sequence ispartitioned, modes indicating how each partition is encoded, one or morereference frames (and reference frame lists) for each inter-encodedblock, and other information to decode the encoded video sequence. Asused herein, in some aspects, a “slice” may refer to a data structurethat can be decoded independently from other slices of the same picture,in terms of entropy coding, signal prediction, and residual signalreconstruction. A slice can either be an entire picture or a region of apicture.

The intra-prediction unit 303 may use intra-prediction modes for examplereceived in the bitstream to form a prediction block from spatiallyadjacent blocks. Intra-prediction can be referred to herein as “intra,”and/or intra-prediction modes can be referred to herein as “intra modes”The inverse quantization unit 304 inverse quantizes, i.e., de-quantizes,the quantized video block coefficients provided in the bitstream anddecoded by entropy decoding unit 301. Inverse transform unit 305 appliesan inverse transform.

The reconstruction unit 306 may sum the residual blocks with thecorresponding prediction blocks generated by motion compensation unit302 or intra-prediction unit 303 to form decoded blocks. If desired, adeblocking filter may also be applied to filter the decoded blocks inorder to remove blockiness artifacts. The decoded video blocks are thenstored in buffer 307, which provides reference blocks for subsequentmotion compensation/intra-prediction and also produces decoded video forpresentation on a display device.

Although the following description may be focused on High EfficiencyVideo Coding (HEVC), and/or the standard Versatile Video Coding (VVC),the concepts described herein may be applicable to other codingstandards or video codec.

FIG. 4 shows an example of a block diagram of a HEVC video encoder anddecoder 400, which may be the video encoder 114 and video decoder 124 inthe system 100 illustrated in FIG. 1, video encoder 200 in FIG. 2 andvideo decoder 300 in FIG. 3, etc., in accordance with some aspects ofthe present disclosure. The encoding algorithm for generatingHEVC-compliant bitstreams may proceed as follows. Each picture can bedivided into block regions (e.g., coding tree units (CTUs)), and theprecise block division may be transmitted to the decoder. A CTU consistsof a luma coding tree block (CTB) and the corresponding chroma CTBs andsyntax elements. The size L×L of a luma CTB can be chosen as L=16, 32,or 64 samples, where the larger sizes can enable higher compression.HEVC then supports a partitioning of the CTBs into smaller blocks usinga tree structure and quadtree-like signaling. The quadtree syntax of theCTU specifies the size and positions of its luma and chroma CBs. Theroot of the quadtree is associated with the CTU. Hence, the size of theluma CTB is the largest supported size for a luma CB. The splitting of aCTU into luma and chroma CBs may be jointly signaled. One luma CB andordinarily two chroma CBs, together with associated syntax, form acoding unit (CU). A CTB may contain only one CU or may be split to formmultiple CUs, and each CU has an associated partitioning into predictionunits (PUs) and a tree of transform units (TUs).

The first picture of the video sequence (and/or the first picture ateach clean random access point that enters the video sequence) can useonly intra-picture prediction, which uses region-to-region spatial dataprediction within the same picture, but does not rely on other picturesto encode the first picture. For the remaining pictures betweensequential or random access points, the inter-picture temporalprediction coding mode may be used for most blocks. The encoding processfor inter-picture prediction includes selecting motion data including aselected reference picture and a motion vector (MV) to be applied topredict samples of each block.

The decision whether to code a picture area using inter-picture orintra-picture prediction can be made at the CU level. A PU partitioningstructure has its root at the CU level. Depending on the basicprediction-type decision, the luma and chroma CBs can then be furthersplit in size and predicted from luma and chroma prediction blocks(PBs). HEVC supports variable PB sizes from 64×64 down to 4×4 samples.The prediction residual is coded using block transforms. A TU treestructure has its root at the CU level. The luma CB residual may beidentical to the luma transform block (TB) or may be further split intosmaller luma TBs. The same applies to the chroma TBs.

The encoder and decoder may apply motion compensation (MC) by using MVand mode decision data to generate the same inter-picture predictionsignal, which is transmitted as auxiliary information. The residualsignal of intra-picture or inter-picture prediction can be transformedby linear spatial transformation, which is the difference between theoriginal block and its prediction. Then the transform coefficients canbe scaled, quantized, entropy encoded, and transmitted together with theprediction information.

The encoder can duplicate the decoder processing loop so that both cangenerate the same prediction for subsequent data. Therefore, thequantized transform coefficients can be constructed by inverse scaling,and then can be inversely transformed to replicate the decodingapproximation of the residual signal. The residual can then be added tothe prediction, and the result of this addition can then be fed into oneor two loop filters to smooth the artifacts caused by block-by-blockprocessing and quantization. The final picture representation (i.e., thecopy output by the decoder) can be stored in the decoded picture bufferfor prediction of subsequent pictures. In general, the order of encodingor decoding processing of pictures may be different from the order inwhich they arrive from the source. As such, in some examples, it may benecessary to distinguish between the decoding order of the decoder (thatis, the bit stream order) and the output order (that is, the displayorder).

Video material encoded by HEVC can be input as a progressive image(e.g., because the source video originates from this format or isgenerated by de-interlacing before encoding). There is no explicitcoding feature in the HEVC design to support the use of interlacedscanning, because interlaced scanning is no longer used for displays andbecomes very uncommon for distribution. However, metadata syntax hasbeen provided in HEVC to allow the encoder to indicate that it has beensent by encoding each area of the interlaced video (i.e., even or oddlines of each video frame) into a separate picture interlaced video, orby encoding each interlaced frame as a HEVC encoded picture to indicatethat it has been sent. This can provide an effective method for encodinginterlaced video without the need to support special decoding processesfor it.

FIG. 5 is an example of an encoder block diagram 500 of VVC, which caninclude multiple in-loop filtering blocks: e.g., deblocking filter (DF),sample adaptive offset (SAO) adaptive loop filter (ALF), etc. Unlike DF,which uses predefined filters, SAO and ALF may utilize the originalsamples of the current picture to reduce the mean square errors betweenthe original samples and the reconstructed samples by adding an offsetand by applying a finite impulse response (FIR) filter, respectively,with coded side information signaling the offsets and filtercoefficients. ALF may be located at the last processing stage of eachpicture and can be regarded as a tool to catch and fix artifacts createdby the previous stages.

FIG. 6 is a schematic diagram 600 of intra-prediction mode coding with67 intra-prediction modes to capture the arbitrary edge directionspresented in natural video. In some examples, the number of directionalintra modes may be extended from 33, as used in HEVC, to 65 while theplanar and the DC modes remain the same.

In some examples, the denser directional intra-prediction modes mayapply for the block sizes and for both luma and chromaintra-predictions. In the HEVC, every intra-prediction mode coded blockmay include a square shape (e.g., a coded block of size N×N) and thelength of each of its side may be a power of 2 (e.g., where N is a powerof 2). Thus, no division operations are required to generate anintra-predictor using DC mode. In VVC, blocks can have a rectangularshape that may necessitate the use of a division operation per block inthe general case. To avoid division operations for DC prediction, thelonger side may be used to compute the average for non-square blocks.

Although 67 modes are defined in the VVC, the exact prediction directionfor a given intra-prediction mode index may be further dependent on theblock shape. Conventional angular intra-prediction directions aredefined from 45 degrees to −135 degrees in clockwise direction. In VVC,several conventional angular intra-prediction modes may be adaptivelyreplaced with wide-angle intra-prediction modes for non-square blocks.The replaced modes may be signaled using the original mode indexes,which are remapped to the indexes of wide angular modes after parsing.In some examples, the total number of intra-prediction modes may beunchanged, i.e., 67, and the intra mode coding method may also beunchanged.

FIGS. 7 and 8 are reference example diagrams 700 and 800 of wide-angularintra-prediction. In some examples, the number of replaced modes inwide-angular direction mode may depend on the aspect ratio of a block.The replaced intra-prediction modes are illustrated in Table 1:

TABLE 1 Intra-prediction modes replaced by wide-angular modes Aspectratio Replaced intra-prediction modes W/H == 16 Modes 2, 3, 4, 5, 6, 7,8, 9, 10, 11, 12, 13, 14, 15 W/H == 8 Modes 2, 3, 4, 5, 6, 7, 8, 9, 10,11, 12, 13 W/H == 4 Modes 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 W/H == 2 Modes2, 3, 4, 5, 6, 7, 8, 9 W/H == 1 None W/H == ½ Modes 59, 60, 61, 62, 63,64, 65, 66 W/H == ¼ Mode 57, 58, 59, 60, 61, 62, 63, 64, 65, 66 W/H == ⅛Modes 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66 W/H == 1/16 Modes53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66

FIG. 9 is a diagram 900 of discontinuity in case of directions thatexceed 45° angle. In such instance, two vertically adjacent predictedsamples may use two non-adjacent reference samples in the case ofwide-angle intra-prediction. Hence, low-pass reference samples filterand side smoothing may be applied to the wide-angle prediction to reducethe negative effect of the increased gap Δp_(α). If a wide-angle moderepresents a non-fractional offset, there may be 8 modes in thewide-angle modes satisfy this condition, which are [−14, −12, −10, −6,72, 76, 78, 80]. When a block is predicted by these modes, the samplesin the reference buffer can be directly copied without applying anyinterpolation. With this modification, the number of samples to besmoothed may be reduced.

In VVC, 4:2:2 and 4:4:4 chroma formats are supported as well as 4:2:0.Chroma derived mode (DM) derivation table for 4:2:2 chroma format wasinitially ported from HEVC extending the number of entries from 35 to 67to align with the extension of intra-prediction modes. As HEVCspecification does not support prediction angle below −135 degree andabove 45 degree, luma intra-prediction modes ranging from 2 to 5 may bemapped to 2. Therefore, chroma DM derivation table for 4:2:2: chromaformat can be updated by replacing some values of the entries of themapping table to convert prediction angle more precisely for chromablocks.

In some aspects, for each inter-predicted CU, motion parametersconsisting of motion vectors, reference picture indices and referencepicture list usage index, and additional information used for the newcoding feature of VVC may be used for inter-predicted sample generation.The motion parameter can be signaled in an explicit or implicit manner.When a CU is coded with skip mode, the CU may be associated with one PUand may have no significant residual coefficients, no coded motionvector delta or reference picture index. A merge mode may be specifiedwhere the motion parameters for the current CU can be obtained fromneighboring CUs, including spatial and temporal candidates, andadditional schedules introduced in VVC. The merge mode can be applied toany inter-predicted CU, not only for skip mode. The alternative to mergemode may be the explicit transmission of motion parameters, where motionvector, corresponding reference picture index for each reference picturelist and reference picture list usage flag and other needed informationare signaled explicitly per each CU.

Additionally or alternatively, intra block copy (IBC) may be a tooladopted in HEVC extensions on SCC, and thus may be used by a videoencoder 114, 200, 400, as described herein in encoding video, and/or bya video decoder 124, 300, 400, as described herein in decoding video.Such a tool may improve the coding efficiency of screen contentmaterials. As IBC mode may be implemented as a block level coding mode,block matching (BM) may be performed at the encoder to find the optimalblock vector (or motion vector) for each CU. Here, a block vector isused to indicate the displacement from the current block to a referenceblock, which is already reconstructed inside the current picture. Theluma block vector of an IBC-coded CU may be in integer precision. Thechroma block vector can round to integer precision as well. Whencombined with AMVR, the IBC mode can switch between 1-pel and 4-pelmotion vector precisions. An IBC-coded CU may be treated as the thirdprediction mode other than intra- or inter-prediction modes. The IBCmode may be applicable to the CUs with both width and height smallerthan or equal to 64 luma samples.

At the encoder side, hash-based motion estimation may be performed forIBC. The encoder performs RD check for blocks with either width orheight no larger than 16 luma samples. For non-merge mode, the blockvector search may be performed using hash-based search first. If hashsearch does not return valid candidate, block matching based localsearch may be performed. In the hash-based search, hash key matching(32-bit cyclic redundancy check (CRC)) between the current block and areference block may be extended to all allowed block sizes. The hash keycalculation for every position in the current picture may be based on4×4 sub-blocks. For the current block of a larger size, a hash key maybe determined to match that of the reference block when all the hashkeys of all 4×4 sub-blocks match the hash keys in the correspondingreference locations. If hash keys of multiple reference blocks are foundto match that of the current block, the block vector costs of eachmatched reference may be calculated and the one with the minimum costmay be selected.

In some examples, in block matching search, the search range may be setto cover both the previous and current CTUs. At CU level, IBC mode maybe signaled with a flag and it can be signaled as IBC AMVP mode or IBCskip/merge mode. In one example, such as IBC skip/merge mode, a mergecandidate index may be used to indicate which of the block vectors inthe list from neighboring candidate IBC coded blocks is used to predictthe current block. The merge list may include spatial, HMVP, andpairwise candidates.

In another example, such as IBC AMVP mode, a block vector difference maybe coded in the same way as a motion vector difference. The block vectorprediction method uses two candidates as predictors, one from leftneighbor and one from above neighbor (if IBC coded). When eitherneighbor is not available, a default block vector can be used as apredictor. A flag can be signaled to indicate the block vector predictorindex.

To reduce the cross-component redundancy, a cross-component linear model(CCLM) prediction mode may be used in the VVC, for which the chromasamples are predicted based on the reconstructed luma samples of thesame CU by using a linear model as follows:pred_(C)(i,j)=α·rec_(L)′(i,j)+β   Equation 1

In such instance, pred_(C)(i, j) may represent the predicted chromasamples in a CU and rec_(L)(i, j) may represent the down-sampledreconstructed luma samples of the same CU. The CCLM parameters (α and β)may be derived with at most four neighboring chroma samples and theircorresponding down-sampled luma samples. For instance, suppose thecurrent chroma block dimensions are W×H, then W″ and H′ are set as W′=W,H′=H when LM mode is applied; W′=W+H when LM-T mode is applied; andH′=H+W when LM-L mode is applied.

The above neighboring positions may be denoted as S[0, −1] . . . S[W′−1,−1] and the left neighboring positions may be denoted as S[−1, 0] . . .S[−1, H′−1]. Then the four samples are selected as S[W′/4, −1],S[3*W′/4, −1], S[−1, H′/4], S[−1, 3*H′/4] when LM mode is applied andboth above and left neighboring samples are available; S[ W′/8, −1], S[3*W′/8, −1], S[5*W′/8, −1], S[ 7*W′/8, −1] when LM−T mode is applied oronly the above neighboring samples are available; and S[−1, H′/8], S[−1,3*H′/8], S[−1, 5*H′/8], S[−1, 7*H′/8] when LM−L mode is applied or onlythe left neighboring samples are available.

In some aspects, the four neighboring luma samples at the selectedpositions may be down-sampled and compared four times to find two largervalues: x⁰ _(A) and x¹ _(A), and two smaller values: x⁰ _(B) and x¹_(B). Their corresponding chroma sample values may be denoted as y⁰_(A), y⁰ _(B) and y¹ _(B). Then x_(A), x_(B), y_(A) and y_(B) may bederived as:X _(a)=(x ⁰ _(A) +x ¹ _(A)+1)>>1; X _(b)=(x ⁰ _(B) +x ¹ _(B)+1)>>1; Y_(a)=(y ⁰ _(A) +y ¹ _(A)+1)>>1; Y _(b)=(y ⁰ _(B) +y ¹ _(B)+1)>>1  Equation 2

Finally, the linear model parameters a and may be obtained according tothe following equations:

$\begin{matrix}{\alpha = \frac{Y_{a} - Y_{b}}{X_{a} - X_{b}}} & {{Equation}\mspace{14mu} 3}\end{matrix}$β=Y _(b) −α·X _(b)  Equation 4

FIG. 10 is a schematic diagram 1000 of location of the samples used forthe derivation of α and β for the chroma. FIG. 11 is a schematic diagram1100 of location of the samples used for the derivation of α and β forthe luma. For both FIGS. 10 and 11, the division operation to calculateparameter a may be implemented with a look-up table. To reduce thememory required for storing the table, the diff value (differencebetween maximum and minimum values) and the parameter a may be expressedby an exponential notation. For example, the diff value is approximatedwith a 4-bit significant part and an exponent. Consequently, the tablefor 1/diff is reduced into 16 elements for 16 values of the significandas follows:

-   -   DivTable[ ]={0,7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0}

Table 2

In an example, the above template and left template can be used tocalculate the linear model coefficients together. In another example,the above template and left template can be used alternatively in theother 2 LM modes, called LM_T, and LM_L modes. In LM_T mode, only theabove template may be used to calculate the linear model coefficients.To get more samples, the above template is extended to (W+H) samples. InLM_L mode, only left template is used to calculate the linear modelcoefficients. To get more samples, the left template may be extended to(H+W) samples. In LM mode, left and above templates are used tocalculate the linear model coefficients.

To match the chroma sample locations for 4:2:0 video sequences, twotypes of down-sampling filter are applied to luma samples to achieve 2to 1 down-sampling ratio in both horizontal and vertical directions. Theselection of down-sampling filter is specified by a SPS level flag. Thetwo down-sampling filters are as follows, which are corresponding to“type-0” and “type-2” content, respectively.

$\begin{matrix}{{{Rec}_{L}^{\prime}\left( {i,j} \right)} = {\left\lbrack {{{rec}_{L}\left( {{{2i} - 1},{2j}} \right)} + {2 \cdot {{rec}_{L}\left( {{{2i} - 1},{{2j} - 1}} \right)}} + {{rec}_{L}\left( {{{2i} + 1},{{2j} - 1}} \right)} + {{rec}_{L}\left( {{{2i} - 1},{2j}} \right)} + {2 \cdot {{rec}_{L}\left( {{2i},{2j}} \right)}} + {{rec}_{L}\left( {{{2i} + 1},{2j}} \right)} + 4} \right\rbrack ⪢ 3}} & {{Equation}\mspace{14mu} 5} \\{{{rec}_{L}^{\prime}\left( {i,j} \right)} = {\quad{\left\lbrack {{{rec}_{L}\left( {{2i},{{2j} - 1}} \right)} + {{rec}_{L}\left( {{{2i} - 1},{2j}} \right)} + {4 \cdot {{rec}_{L}\left( {{2i},{2j}} \right)}} + {{rec}_{L}\left( {{{2i} + 1},{2j}} \right)} + {{rec}_{L}\left( {{2i},{{2j} + 1}} \right)} + 4} \right\rbrack ⪢ 3}}} & {{Equation}\mspace{14mu} 6}\end{matrix}$

Note that only one luma line (general line buffer in intra-prediction)may be used to make the down-sampled luma samples when the upperreference line is at the CTU boundary. This parameter computation may beperformed as part of the decoding process, and not just as an encodersearch operation. As a result, no syntax may be used to convey the α andβ values to the decoder.

For chroma intra-prediction mode coding, a total of 8 intra-predictionmodes are allowed for chroma intra mode coding. Those modes include fivetraditional intra-prediction modes and three cross-component linearmodel modes (LM, LM_T, and LM_L). Chroma mode signaling and derivationprocess are shown in Table 3 below. Chroma mode coding directly dependson the intra-prediction mode of the corresponding luma block. Asseparate block partitioning structure for luma and chroma components isenabled in I slices, one chroma block may correspond to multiple lumablocks. Therefore, for Chroma DM mode, the intra-prediction mode of thecorresponding luma block covering the center position of the currentchroma block can be directly inherited.

TABLE 3 Chroma mode signaling and derivation process Chroma predictionCorresponding luma mode intra-prediction mode 0 50 18 1 X (0 <= X <= 66)0 66 0 0 0 0 1 50 66 50 50 50 2 18 18 66 18 18 3 1 1 1 66 1 4 0 50 18 1X 5 81 81 81 81 81 6 82 82 82 82 82 7 83 83 83 83 83

TABLE 4 Unified binarization table for chroma prediction mode Value ofintra_chroma_pred_mode Bin string 4 00 0 0100 1 0101 2 0110 3 0111 5 106 110 7 111

In Table 4, the first bin indicates whether it is regular (0) or LMmodes (1). If it is LM mode, then the next bin indicates whether it isLM_CHROMA (0) or not (1). If it is not LM_CHROMA, next bin indicateswhether it is LM_L (0) or LM_T (1). For this case, whensps_cclm_enabled_flag is 0, the first bin of the binarization table forthe corresponding intra_chroma_pred_mode can be discarded prior to theentropy coding. In other words, the first bin is inferred to be 0 andhence not coded. This single binarization table is used for bothsps_cclm_enabled_flag equal to 0 and 1 cases. The first two bins inTable 4 are context coded with its own context model, and the rest ofthe bins are bypass coded.

In addition, in order to reduce luma-chroma latency in dual tree, whenthe 64×64 luma coding tree node is partitioned with Not Split (and ISPis not used for the 64×64 CU) or QT, the chroma CUs in 32×32/32×16chroma coding tree node is allowed to use CCLM in the following way: Ifthe 32×32 chroma node is not split or partitioned QT split, all chromaCUs in the 32×32 node can use CCLM; Alternatively, if the 32×32 chromanode is partitioned with Horizontal BT, and the 32×16 child node doesnot split or uses Vertical BT split, all chroma CUs in the 32×16 chromanode can use CCLM. In all the other luma and chroma coding tree splitconditions, CCLM is not allowed for chroma CU.

In VVC, the results of intra-prediction of DC, planar and severalangular modes may further be modified by a position dependent predictioncombination (PDPC) method. PDPC is a prediction method that invokes acombination of the boundary reference samples and HEVC style predictionwith filtered boundary reference samples. PDPC can be applied to thefollowing intra modes without signaling: planar, DC, intra angles lessthan or equal to horizontal, and intra angles greater than or equal tovertical and less than or equal to 80. If the current block is BDPCMmode or MRL index is larger than 0, PDPC is not applied.

The prediction sample pred(x′,y′) is predicted using an intra-predictionmode (DC, planar, angular) and a linear combination of reference samplesaccording to the Equation 7 as follows:pred(x′,y′)=Clip(0,(1<<BitDepth)−1,(wL×R _(−1,y′) +wT×R_(x′,−1)+(64−wL−wT)×pred(x′,y′)+32)>>6)   Equation 7

In the above equation, R_(x,−1), R_(−1,y) may represent the referencesamples located at the top and left boundaries of current sample (x, y),respectively

In some aspects, if PDPC is applied to DC, planar, horizontal, andvertical intra modes, additional boundary filters may not be needed, ascurrently required in the case of HEVC DC mode boundary filter orhorizontal/vertical mode edge filters. PDPC process for DC and planarmodes is identical. For angular modes, if the current angular mode isHOR_IDX or VER_IDX, left or top reference samples is not used,respectively. The PDPC weights and scale factors are dependent onprediction modes and the block sizes. PDPC is applied to the block withboth width and height greater than or equal to 4.

FIGS. 12-15 illustrate examples of reference samples 1200, 1300, 1400,1500 (R_(x,−1) and R_(−1,y)) for PDPC applied over various predictionmodes. The prediction sample pred(x′, y′) is located at (x′, y′) withinthe prediction block. As an example, the coordinate x of the referencesample R_(x,−1) is given by: x=x′+y′+1, and the coordinate y of thereference sample R_(−1,y) is similarly given by: y=x′+y′+1 for thediagonal modes. For the other angular mode, the reference samplesR_(x,−1) and R_(−1,y) could be located in fractional sample position. Inthis case, the sample value of the nearest integer sample location isused.

FIG. 16 is a diagram 1600 of multiple reference line (MRL)intra-prediction used in accordance with aspects of the presentdisclosure. In some examples, the samples of segments A and F are notfetched from reconstructed neighboring samples but padded with theclosest samples from Segment B and E, respectively. HEVC intra-pictureprediction uses the nearest reference line (i.e., reference line 0). InMRL, 2 additional lines (reference line 1 and reference line 3) areused.

In some examples of video coding, the index of selected reference line(mrl_idx) can be signaled and used to generate intra predictor. Forreference line index, which is greater than 0, the most probable mode(MPM) list may only include additional reference line modes and the MPMindex can be signaled without remaining modes. The reference line indexcan be signaled before intra-prediction modes, and planar mode can beexcluded from intra-prediction modes in case a non-zero reference lineindex is signaled.

MRL can be disabled for the first line of blocks inside a CTU to preventusing extended reference samples outside the current CTU line. Also,PDPC can be disabled when an additional line is used. For MRL mode, thederivation of DC value in DC intra-prediction mode for non-zeroreference line indices can be aligned with that of reference line index0. MRL may store 3 neighboring luma reference lines with a CTU togenerate predictions. The Cross-Component Linear Model (CCLM) tool maystore 3 neighboring luma reference lines for its down-sampling filters.The definition of MRL to use the same 3 lines can be aligned as CCLM toreduce the storage requirements for decoders.

FIGS. 17 and 18 are examples of diagrams 1700 and 1800 of an intrasub-partitions (ISP) that divides luma intra-predicted blocks verticallyor horizontally into sub-partitions depending on the block size. Forexample, minimum block size for ISP is 4×8 (or 8×4). If block size isgreater than 4×8 (or 8×4) then the corresponding block can be divided by4 sub-partitions. It has been noted that the M×128 (with M≤64) and 128×N(with N≤64) ISP blocks could generate a potential issue with the 64×64VDPU. For example, an M×128 CU in the single tree case has an M×128 lumaTB and two corresponding

$\frac{M}{2} \times 64$chroma TBs. If the CU uses ISP, then the luma TB can be divided intofour M×32 TBs (only the horizontal split is possible), each of themsmaller than a 64×64 block. However, in the current design of ISP chromablocks are not divided. Therefore, both chroma components may have asize greater than a 32×32 block. Analogously, a similar situation couldbe created with a 128×N CU using ISP. Hence, these two cases may be anissue for the 64×64 decoder pipeline. For this reason, the CU sizes thatcan use ISP may be restricted to a maximum of 64×64. FIGS. 17 and 18shows examples of the two possibilities. All sub-partitions fulfill thecondition of having at least 16 samples.

In ISP, the dependence of 1×N/2×N subblock prediction on thereconstructed values of previously decoded 1×N/2×N subblocks of thecoding block is not allowed so that the minimum width of prediction forsubblocks becomes four samples. For example, an 8×N (N>4) coding blockthat is coded using ISP with vertical split is split into two predictionregions each of size 4×N and four transforms of size 2×N. Also, a 4×Ncoding block that is coded using ISP with vertical split is predictedusing the full 4×N block; four transform each of 1×N is used. Althoughthe transform sizes of 1×N and 2×N are allowed, it is asserted that thetransform of these blocks in 4×N regions can be performed in parallel.For example, when a 4×N prediction region contains four 1×N transforms,there is no transform in the horizontal direction; the transform in thevertical direction can be performed as a single 4×N transform in thevertical direction. Similarly, when a 4×N prediction region contains two2×N transform blocks, the transform operation of the two 2×N blocks ineach direction (horizontal and vertical) can be conducted in parallel.In this example, there may be no delay, or reduced delay, added inprocessing these smaller blocks than processing 4×4 regular-coded intrablocks.

TABLE 5 Block Size Coefficient group Size 1 × N, N ≥ 16  1 × 16 N × 1, N≥ 16 16 × 1  2 × N, N ≥ 8 2 × 8 N × 2, N ≥ 8 8 × 2 All other possible M× N cases 4 × 4

For each sub-partition, reconstructed samples are obtained by adding theresidual signal to the prediction signal. Here, a residual signal isgenerated by the processes such as entropy decoding, inversequantization and inverse transform. Therefore, the reconstructed samplevalues of each sub-partition can be available to generate the predictionof the next sub-partition, and each sub-partition is repeatedlyprocessed. In addition, the first sub-partition to be processed is theone containing the top-left sample of the CU and then continuingdownwards (horizontal split) or rightwards (vertical split). As aresult, reference samples used to generate the sub-partitions predictionsignals may only be located at the left and above sides of the lines.All sub-partitions can share the same intra mode. The followings aresummary of interaction of ISP with other coding tools.

In one example, MRL may be implemented if a block has an MRL index otherthan 0, then the ISP coding mode can be inferred to be 0 and thereforeISP mode information may not be sent to the decoder. In another example,entropy coding coefficient group size may be selected if the sizes ofthe entropy coding subblocks have been modified so that they have 16samples in all possible cases, as shown in Table 5. Note that the newsizes may only affect blocks produced by ISP in which one of thedimensions is less than 4 samples. In all other cases coefficient groupsmay keep the 4×4 dimensions.

Additionally or alternatively, with respect to coded block flag (CBF)coding, it is assumed to have at least one of the sub-partitions has anon-zero CBF. Hence, if n is the number of sub-partitions and the firstn−1 sub-partitions have produced a zero CBF, then the CBF of the n-thsub-partition can be inferred to be 1. Transform size restriction: allISP transforms with a length larger than 16 points can use the discretecosine transform (DCT)-II. Multiple transform selection (MTS) flag: if aCU uses the ISP coding mode, the MTS CU flag may be set to 0 and it maynot be sent to the decoder. Therefore, the encoder may not perform ratedistortion (RD) tests for the different available transforms for eachresulting sub-partition. The transform choice for the ISP mode mayinstead be fixed and selected according the intra mode, the processingorder and the block size utilized. Hence, no signaling may be required,in this example.

For example, let t_(H) and t_(V) be the horizontal and the verticaltransforms selected respectively for the w×h sub-partition, where w isthe width and h is the height. Then the transform can be selectedaccording to the following rules: If w=1 or h=1, then there may be nohorizontal or vertical transform respectively. If w≥4 and w≤16,t_(H)=discrete sine transform (DST)-VII, otherwise, t_(H)=DCT-II. If h≥4and h≤16, t_(V)=DST-VII, otherwise, t_(V)=DCT-II.

In ISP mode, all 67 intra-prediction modes are allowed. PDPC can also beapplied if corresponding width and height is at least 4 samples long. Inaddition, the reference sample filtering process (reference smoothing)and the condition for intra interpolation filter selection may not existanymore, and Cubic (DCT-IF) filter can be applied for fractionalposition interpolation in ISP mode.

FIG. 19 is an example of a diagram 1900 of matrix weightedintra-prediction process (MIP) for VVC. For predicting the samples of arectangular block of width W and height H, −MIP takes one line of Hreconstructed neighboring boundary samples left of the block and oneline of W reconstructed neighboring boundary samples above the block asinput. If the reconstructed samples are unavailable, they can begenerated as in the conventional intra-prediction.

Among the boundary samples, four samples or eight samples can beselected by averaging based on block size and shape. Specifically, theinput boundaries bdry^(top) and bdry^(left) are reduced to smallerboundaries bdry_(red) ^(top) and bdry_(red) ^(left) by averagingneighboring boundary samples according to predefined rule depends onblock size. Then, the two reduced boundaries bdry_(red) ^(top) andbdry_(red) ^(left) can be concatenated to a reduced boundary vectorbdry_(red) which is thus of size four for blocks of shape 4×4 and ofsize eight for blocks of all other shapes. If mode refers to theMIP-mode, this concatenation is defined as follows:

$\begin{matrix}{{bdry}_{red} = \left\{ \begin{matrix}\left\lbrack {{bdry}_{red}^{top},{bdry}_{red}^{left}} \right\rbrack & {{{for}\mspace{14mu} W} = {H = {{4\mspace{14mu}{and}\mspace{14mu}{mode}} < 18}}} \\\left\lbrack {{bdry}_{red}^{left},{bdry}_{red}^{top}} \right\rbrack & {{{for}\mspace{14mu} W} = {H = {{4\mspace{14mu}{and}\mspace{14mu}{mode}} \geq 18}}} \\\left\lbrack {{bdry}_{red}^{top},{bdry}_{red}^{left}} \right\rbrack & {{{for}\mspace{14mu}{\max\left( {W,H} \right)}} = {{8\mspace{14mu}{and}\mspace{14mu}{mode}} < 10}} \\\left\lbrack {{bdry}_{red}^{left},{bdry}_{red}^{top}} \right\rbrack & {{{for}\mspace{14mu}{\max\left( {W,H} \right)}} = {{8\mspace{14mu}{and}\mspace{14mu}{mode}} \geq 10}} \\\left\lbrack {{bdry}_{red}^{top},{bdry}_{red}^{left}} \right\rbrack & {{{for}\mspace{14mu}{\max\left( {W,H} \right)}} > {8\mspace{14mu}{and}\mspace{14mu}{mode}} < 6} \\\left\lbrack {{bdry}_{red}^{left},{bdry}_{red}^{top}} \right\rbrack & {{{for}\mspace{14mu}{\max\left( {W,H} \right)}} > {8{\mspace{11mu}\;}{and}\mspace{14mu}{mode}} \geq 6.}\end{matrix} \right.} & {{Equation}\mspace{14mu} 8}\end{matrix}$

A matrix vector multiplication, followed by addition of an offset, iscarried out with the averaged samples as an input. The result is areduced prediction signal on a subsampled set of samples in the originalblock. Out of the reduced input vector bdry_(red) a reduced predictionsignal pred_(red), which is a signal on the down-sampled block of widthW_(red) and height H_(red) is generated. Here, W_(red) and H_(red) aredefined as:

$\begin{matrix}{W_{red} = \left\{ {{\begin{matrix}4 & {{{for}\mspace{14mu}{\max\left( {W,H} \right)}} \leq 8} \\{\min\left( {W,8} \right)} & {{{for}\mspace{14mu}{\max\left( {W,H} \right)}} > 8}\end{matrix}H_{red}} = \left\{ \begin{matrix}4 & {{{for}\mspace{14mu}{\max\left( {W,H} \right)}} \leq 8} \\{\min\left( {H,8} \right)} & {{{for}\mspace{14mu}{\max\left( {W,H} \right)}} > 8}\end{matrix} \right.} \right.} & {{Equation}\mspace{14mu} 9}\end{matrix}$

The reduced prediction signal pred_(red) may be computed by calculatinga matrix vector product and adding an offset:pred_(red) =A·bdry_(red) +b   Equation 10

Here, A is a matrix that has W_(red)·H_(red) rows and 4 columns if W=H=4and 8 columns in all other cases. b is a vector of size W_(red)·H_(red).The matrix A and the offset vector b are taken from one of the sets S₀,S₁, S₂. One defines an index idx=idx(W, H) as follows:

$\begin{matrix}{{{idx}\left( {W,H} \right)} = \left\{ \begin{matrix}0 & {{{for}\mspace{14mu} W} = {H = 4}} \\1 & {{{for}\mspace{14mu}{\max\left( {W,H} \right)}} = 8} \\2 & {{{for}\mspace{14mu}{\max\left( {W,H} \right)}} > 8.}\end{matrix} \right.} & {{Equation}\mspace{14mu} 11}\end{matrix}$

Here, each coefficient of the matrix A is represented with 8 bitprecision. The set S₀ consists of 16 matrices A₀ ^(i), i∈{0, . . . , 15}each of which has 16 rows and 4 columns and 16 offset vectors b₀ ^(i),i∈{0, . . . , 16} each of size 16. Matrices and offset vectors of thatset are used for blocks of size 4×4. The set S₁ consists of 8 matricesA₁ ^(i), i∈{0, . . . , 7}, each of which has 16 rows and 8 columns and 8offset vectors b₁ ^(i), i∈{0, . . . , 7} each of size 16. The set S₂consists of 6 matrices A₂ ^(i), i∈{0, . . . , 5}, each of which has 64rows and 8 columns and of 6 offset vectors b₂ ^(i), i∈{0, . . . , 5} ofsize 64.

In some examples, the prediction signal at the remaining positions maybe generated from the prediction signal on the subsampled set by linearinterpolation which is a single step linear interpolation in eachdirection. The interpolation can be firstly performed in the horizontaldirection and then in the vertical direction regardless of block shapeor block size.

For each CU in intra mode, a flag indicating whether an MIP mode may beto be applied or not is sent. If an MIP mode is to be applied, MIP mode(predModeIntra) may be signaled. For an MIP mode, a transposed flag(isTransposed), which determines whether the mode is transposed, and MIPmode ID (modeId), which determines which matrix is to be used for thegiven MIP mode, can be derived as followsisTransposed=predModeIntra&1modeId=predModeIntra>>1   Equation 12

MIP coding mode may be harmonized with other coding tools by consideringfollowing aspects: (1) low-frequency non-separable transform (LFNST) isenabled for MIP on large blocks. Here, the LFNST transforms of planarmode are used; (2) the reference sample derivation for MIP is performedexactly or at least similarly as for the conventional intra-predictionmodes; (3) for the up-sampling step used in the MIP-prediction, originalreference samples are used instead of down-sampled ones; (4) clipping isperformed before up-sampling and not after up-sampling; (5) MIP may beallowed up to 64×64 regardless of the maximum transform size. In someaspects, the number of MIP modes may be 32 for sizeId=0, 16 for sizeId=1and 12 for sizeId=2.

In joint exploration model (JEM)-2.0 intra modes are extended to 67 from35 modes in HEVC, and they are derived at encoder and explicitlysignaled to decoder. A significant amount of overhead is spent on intramode coding in JEM-2.0. For example, the intra mode signaling overheadmay be up to 5˜10% of overall bitrate in all intra coding configuration.This contribution proposes the decoder-side intra mode derivationapproach to reduce the intra mode coding overhead while keepingprediction accuracy. To reduce the overhead of intra mode signaling, adecoder-side intra mode derivation (DIMD) approach, which may be used byvideo decoders 124, 300, 400 in decoding video. In accordance withaspects of the present disclosure, instead of signaling intra modeexplicitly, the information can be derived at both encoder and decoderfrom the neighboring reconstructed samples of current block. The intramode derived by DIMD may be used in two ways, for example: 1) For 2N×2NCUs, the DIMD mode is used as the intra mode for intra-prediction whenthe corresponding CU-level DIMD flag is turned on; 2) For N×N CUs, theDIMD mode is used to replace one candidate of the existing MPM list toimprove the efficiency of intra mode coding.

FIG. 20 is an example of a diagram 2000 of a template based intra modederivation where the target denotes the current block (of block size N)for which intra-prediction mode is to be estimated. The template(indicated by the patterned region in FIG. 20) specifies a set ofalready reconstructed samples, which are used to derive the intra mode.The template size is denoted as the number of samples within thetemplate that extends to the above and the left of the target block,i.e., L. In some implementations, a template size of 2 (i.e., L=2) canbe used for 4×4 and 8×8 blocks and a template size of 4 (i.e., L=4) canbe used for 16×16 and larger blocks. The reference of template(indicated by the dotted region in FIG. 20) can refer to a set ofneighboring samples from above and left of the template, as defined byJEM-2.0. Unlike the template samples which are always from reconstructedregion, the reference samples of template may not be reconstructed yetwhen encoding/decoding the target block. In this case, the existingreference samples substitution algorithm of JEM-2.0 is utilized tosubstitute the unavailable reference samples with the availablereference samples.

For each intra-prediction mode, the DIMD calculates the absolutedifference (SAD) between the reconstructed template samples and itsprediction samples obtained from the reference samples of the template.The intra-prediction mode that yields the minimum SAD may be selected asthe final intra-prediction mode of the target block.

For intra 2N×2N CUs, the DIMD can be used as one additional intra mode,which can be adaptively selected by comparing the DIMD intra mode withthe optimal normal intra mode (i.e., being explicitly signaled). Oneflag is signaled for each intra 2N×2N CU to indicate the usage of theDIMD. If the flag is one, then the CU can be predicted using the intramode derived by DIMD; otherwise, the DIMD is not applied and the CU ispredicted using the intra mode explicitly signaled in the bit-stream.When the DIMD is enabled, chroma components can reuse the same intramode as that derived for luma component, i.e., DM mode.

Additionally, for each DIMD-coded CU, the blocks in the CU canadaptively select to derive their intra modes at either PU-level orTU-level. Specifically, when the DIMD flag is one, another CU-level DIMDcontrol flag can be signaled to indicate the level at which the DIMD isperformed. If this flag is zero, this can indicate that the DIMD isperformed at the PU level and all the TUs in the PU use the same derivedintra mode for their intra-prediction; otherwise if the DIMD controlflag is one, this can indicate that the DIMD is performed at the TUlevel and each TU in the PU derives its own intra mode.

Further, when the DIMD is enabled, the number of angular directionsincreases to 129, and the DC and planar modes still remain the same. Toaccommodate the increased granularity of angular intra modes, theprecision of intra interpolation filtering for DIMD-coded CUs increasesfrom 1/32-pel to 1/64-pel. Additionally, in order to use the derivedintra mode of a DIMD coded CU as MPM candidate for neighboring intrablocks, those 129 directions of the DIMD-coded CUs can be converted to“normal” intra modes (i.e., 65 angular intra directions) before they areused as MPM.

In some aspects, intra modes of intra N×N CUs are signaled. However, toimprove the efficiency of intra mode coding, the intra modes derivedfrom DIMD are used as MPM candidates for predicting the intra modes offour PUs in the CU. In order to not increase the overhead of MPM indexsignaling, the DIMD candidate can be placed at the first place in theMPM list and the last existing MPM candidate can be removed. Also, apruning operation can be performed such that the DIMD candidate may notbe added to the MPM list if it is redundant.

In order to reduce encoding/decoding complexity, one straightforwardfast intra mode search algorithm is used for DIMD. Firstly, one initialestimation process can be performed to provide a good starting point forintra mode search. Specifically, an initial candidate list can becreated by selecting N fixed modes from the allowed intra modes. Then,the SAD can be calculated for all the candidate intra modes and the onethat minimizes the SAD can be selected as the starting intra mode. Toachieve a good complexity/performance trade-off, the initial candidatelist can include 11 intra modes, including DC, planar and every 4-thmode of the 33 angular intra directions as defined in HEVC, i.e., intramodes 0, 1, 2, 6, 10 . . . 30, 34.

If the starting intra mode is either DC or planar, it can be used as theDIMD mode. Otherwise, based on the starting intra mode, one refinementprocess can then be applied where the optimal intra mode is identifiedthrough one iterative search. In the iterative search, at eachiteration, the SAD values for three intra modes separated by a givensearch interval can be compared and the intra mode that minimizes theSAD can be maintained. The search interval can then be reduced to half,and the selected intra mode from the last iteration can serve as thecenter intra mode for the current iteration. For the current DIMDimplementation with 129 angular intra directions, up to 4 iterations canbe used in the refinement process to find the optimal DIMD intra mode.

In some examples, transmitting of the luma intra-prediction mode in thebitstream can be avoided. This is done by deriving the luma intra modeusing previously encoded/decoded pixels, in an identical fashion at theencoder and at the decoder. This process defines a new coding modecalled DIMD, whose selection signaled in the bitstream for intra codedblocks using a flag. DIMD can compete with other coding modes at theencoder, including the classic Intra coding mode (where theintra-prediction mode is coded). Note that in one example, DIMD may onlyapply to luma. For chroma, classical intra coding mode may apply. Asdone for other coding modes (classical intra, inter, merge, etc.), arate-distortion cost can be computed for the DIMD mode, and can then becompared to the coding costs of other modes to decide whether to selectit as final coding mode for a current block.

At the decoder side, the DIMD flag can be first parsed, if present. Ifthe DIMD flag is true, the intra-prediction mode can be derived in thereconstruction process using the same previously encoded neighboringpixels. If not, the intra-prediction mode can be parsed from thebitstream as in classical intra coding mode.

To derive the intra-prediction mode for a block, a set of neighboringpixels may be first selected on which a gradient analysis is performed.For normativity purposes, these pixels can be in thedecoded/reconstructed pool of pixels. FIG. 21 is an example of a diagram2100 of a template of a set of chosen pixels on which a gradientanalysis may be performed based on intra-prediction mode derivation. Asshown in FIG. 21, a template surrounding the current block is chosen byT pixels to the left, and T pixels above. For example, T may have avalue of 2.

Next, a gradient analysis is performed on the pixels of the template.This can facilitate determining a main angular direction for thetemplate, which can be assumed to have a high chance to be identical tothe one of the current block. Thus, a simple 3×3 Sobel gradient filtercan be used, defined by the following matrices that may be convolutedwith the template:

$M_{x} = {{\begin{bmatrix}{- 1} & 0 & 1 \\{- 2} & 0 & 2 \\{- 1} & 0 & 1\end{bmatrix}\mspace{14mu}{and}\mspace{14mu} M_{y}} = \begin{bmatrix}{- 1} & {- 2} & {- 1} \\0 & 0 & 0 \\1 & 2 & 1\end{bmatrix}}$

For each pixel of the template, each of these two matrices with the 3×3window centered around the current pixel can be point-by-pointmultiplied and composed of its 8 direct neighbors, and the result can beis summed. Thus, two values G_(x) (from the multiplication with M_(x)),and G_(y) (from the multiplication with M_(y)) corresponding to thegradient at the current pixel can be obtained, in the horizontal andvertical direction respectively.

FIG. 22 is an example of a diagram of a convolution of a 3×3 Sobelgradient filter with the template in accordance with aspects of thepresent disclosure. In some examples, the pixel 2210 is the currentpixel. Template pixels 2220 (including the current pixel 2210) arepixels on which the gradient analysis is possible. Unavailable pixels2230 are pixels on which the gradient analysis is not possible due tolack of some neighbors. Reconstructed pixels 2240 are available pixelsoutside of the considered template, used in the gradient analysis of thetemplate pixels 2220. In case a reconstructed pixel 2240 is notavailable (due to blocks being too close to the border of the picturefor instance), the gradient analysis of all template pixels 2220 thatuse the unavailable reconstructed pixel 2240 is not performed.

For each template pixel 2220, the intensity (G) and the orientation (O)of the gradient using G_(x) and G_(y) are calculated as such:

$G = {{{G_{x}} + {{G_{y}}\mspace{14mu}{and}\mspace{14mu} O}} = {{atan}\left( \frac{G_{y}}{G_{x}} \right)}}$

Note that a fast implementation of the atan function is proposed. Theorientation of the gradient can then be converted into an intra angularprediction mode, used to index a histogram (first initialized to zero).The histogram value at that intra angular mode is increased by G. Onceall the template pixels 2220 in the template have been processed, thehistogram can include cumulative values of gradient intensities, foreach intra angular mode. The mode that shows the highest peak in thehistogram can be selected as intra-prediction mode for the currentblock. If the maximum value in the histogram is 0 (meaning no gradientanalysis was able to be made, or the area composing the template isflat), then the DC mode can be selected as intra-prediction mode for thecurrent block.

For blocks that are located at the top of CTUs, the gradient analysis ofthe pixels located in the top part of the template is not performed. TheDIMD flag is coded using three possible contexts, depending on the leftand above neighboring blocks, similarly to the Skip flag coding. Context0 corresponds to the case where none of the left and above neighboringblocks are coded with DIMD mode, context 1 corresponds to the case whereonly one neighboring block is coded with DIMD, and context 2 correspondsto the case where both neighbors are DIMD-coded. Initial symbolprobabilities for each context are set to 0.5.

One advantage that DIMD offers over classical intra mode coding is thatthe derived intra mode can have a higher precision, allowing moreprecise predictions at no additional cost as it is not transmitted inthe bitstream. The derived intra mode spans 129 angular modes, hence atotal of 130 modes including DC (e.g., the derived intra mode may not beplanar in aspects described herein). The classical intra coding mode isunchanged, i.e., the prediction and mode coding still use 67 modes.

The required changes to Wide Angle Intra-prediction and simplified PDPCwere performed to accommodate for prediction using 129 modes. Note thatonly the prediction process uses the extended intra modes, meaning thatfor any other purpose (deciding whether to filter the reference samplesfor instance), the mode can be converted back to 67-mode precision.

In the DIMD mode, the luma intra mode is derived during thereconstruction process, just prior to the block reconstruction. This isdone to avoid a dependency on reconstructed pixels during parsing.However, by doing so, the luma intra mode of the block may be undefinedfor the chroma component of the block, and for the luma component ofneighboring blocks. This can cause an issue because for chroma, a fixedmode candidate list is defined. Usually, if the luma mode equals one ofthe chroma candidates, that candidate may be replaced with the verticaldiagonal (VDIA_IDX) intra mode. As in DIMD, the luma mode isunavailable, the initial chroma mode candidate list is not modified.

In classical intra mode, where the luma intra-prediction mode is to beparsed from the bitstream, an MPM list is constructed using the lumaintra modes of neighboring blocks, which can be unavailable if thoseblocks were coded using DIMD. In this case, for example, DIMD-codedblocks can be treated as inter blocks during MPM list construction,meaning they are effectively considered unavailable.

Entropy coding may be a form of lossless compression used at the laststage of video encoding (and the first stage of video decoding), afterthe video has been reduced to a series of syntax elements. Syntaxelements describe how the video sequence can be reconstructed at thedecoder. This includes the method of prediction (e.g., spatial ortemporal prediction, intra-prediction mode, and motion vectors) andprediction error, also referred to as residual. Arithmetic coding is atype of entropy coding that can achieve compression close to the entropyof a sequence by effectively mapping the symbols (i.e., syntax elements)to codewords with a non-integer number of bits. Context-adaptive binaryarithmetic coding (CABAC) involves three main functions: binarization,context modeling, and arithmetic coding. Binarization maps the syntaxelements to binary symbols (bins). Context modeling estimates theprobability of the bins. Finally, arithmetic coding compresses the binsto bits based on the estimated probability.

Several different binarization processes are used in VVC, such as thetruncated Rice (TR) binarization process, the truncated binarybinarization process, the k-th order Exp-Golomb (EGk) binarizationprocess and the fixed-length (FL) binarization process.

Context modeling provides an accurate probability estimate required toachieve high coding efficiency. Accordingly, it is highly adaptive anddifferent context models can be used for different bins and theprobability of that context model is updated based on the values of thepreviously coded bins. Bins with similar distributions often share thesame context model. The context model for each bin can be selected basedon the type of syntax element, bin position in syntax element (binIdx),luma/chroma, neighboring information, etc. A context switch can occurafter each bin.

Arithmetic coding may be based on recursive interval division. A range,with an initial value of 0 to 1, is divided into two subintervals basedon the probability of the bin. The encoded bits provide an offset that,when converted to a binary fraction, selects one of the twosubintervals, which indicates the value of the decoded bin. After everydecoded bin, the range is updated to equal the selected subinterval, andthe interval division process repeats itself. The range and offset havelimited bit precision, so renormalization may be used whenever the rangefalls below a certain value to prevent underflow. Renormalization canoccur after each bin is decoded. Arithmetic coding can be done using anestimated probability (context coded), or assuming equal probability of0.5 (bypass coded). For bypass coded bins, the division of the rangeinto subintervals can be done by a shift, whereas a look up table may beused for the context coded bins.

FIG. 23 is a schematic diagram 2300 of intra mode coding with greaterthan 67 intra-prediction modes to capture the arbitrary edge directionspresented in natural video. In some examples, the number of directionalintra modes may be extended from 67, as used in VVC, to 129 while theplanar and the DC modes remain the same.

In one example, the pre-defined IPMs may be the IPMs have denserdirections than conventional IPMs (e.g., IPMs denoted by the dashedlines in FIG. 23). In one example, the N1 IPMs may be partial or full ofthe MPMs for the current block. In one example, some pre-definedintra-prediction modes which are not in MPMs may also be contained inthe given IPM candidate set.

In one example, one or more IPMs fromDC/Planar/horizontal/vertical/diagonal top-right/diagonalbottom-left/diagonal top-left modes may be contained in the given IPMset.

In one example, one or more IPMs denoted by the dashed lines in FIG. 23may be contained in the given IPM set.

In one example, N1 may be equal to or larger than N2 when one or moreIPMs denoted by the dashed red lines are contained in the given IPM set.

In one example, N1 may be equal to or larger than N2.

FIGS. 24-31 illustrate examples of templates that may be formed from oneor more sub-templates. As discussed in further detail below, thetemplate for a block may be selected for the specific block. Forinstance, the template may be selected based on decoded informationabout the specific block or based on availability of the sub-templatesfor the specific block. Although several examples are illustrated, othertemplates may be selected based on different combinations of thesub-templates.

FIG. 24 is a diagram of an example of a template 2400 including aleft-above sub-template 2420 (Template-LA). The template 2400 may beselected for a block 2410, which may have dimensions of M sampleshorizontally and N samples vertically. The left-above sub-template 2420may include left-above neighboring samples that are located both to theleft of the block 2410 and above the block 2410. The left-abovesub-template 2420 may have dimensions of L1 samples horizontally and L2samples vertically. L1 and L2 may be defined for the block 2410, a sliceincluding the block 2410, or a picture including the block 2410.

FIG. 25 is a diagram of an example of a template 2500 including a leftsub-template 2440 (Template-L) and an above sub-template 2430(Template-A). The template 2500 may be selected for a block 2410, whichmay have dimensions of M samples horizontally and N samples vertically.The left sub-template 2440 may include samples located to the left ofthe block 2410. The left sub-template 2440 may be adjacent the top edgeof the block 2410. The left sub-template 2440 may have dimensions of L1samples horizontally and N samples vertically. The above sub-template2430 may include samples located above the block 2410. The abovesub-template 2430 may be adjacent the top edge of the block 2410. Theabove sub-template 2430 may have dimensions of M samples horizontallyand L2 samples vertically.

FIG. 26 is a diagram of an example of a template 2600 including theabove sub-template 2430 (Template-A). The template 2600 may be selectedfor a block 2410, which may have dimensions of M samples horizontallyand N samples vertically. The above sub-template 2430 may includesamples located above the block 2410. The above sub-template 2430 mayhave dimensions of M samples horizontally and L2 samples vertically.

FIG. 27 is a diagram of an example of a template 2700 including a leftsub-template (Template-L). The template 2700 may be selected for a block2410, which may have dimensions of M samples horizontally and N samplesvertically. The left sub-template 2440 may include samples located tothe left of the block 2410. The left sub-template 2440 may havedimensions of L1 samples horizontally and N samples vertically.

FIG. 28 is a diagram of an example of a template 2800 including the leftsub-template 2440 (Template-L) and a left-below sub-template 2450(Template-LB). The template 2800 may be selected for a block 2410, whichmay have dimensions of M samples horizontally and N samples vertically.The left sub-template 2440 may include samples located to the left ofthe block 2410. The left sub-template 2440 may have dimensions of L1samples horizontally and N samples vertically. The left-belowsub-template 2450 may include samples that are located both to the leftof the block 2410 and below the block 2410. The left-below sub-template2450 may have dimensions of L1 samples horizontally and N samplesvertically.

FIG. 29 is a diagram of an example of a template 2900 including theabove sub-template 2430 (Template-A) and a right-above sub-template 2460(Template-RA). The template 2900 may be selected for a block 2410, whichmay have dimensions of M samples horizontally and N samples vertically.The above sub-template 2430 may include samples located above the block2410. The above sub-template 2430 may have dimensions of M sampleshorizontally and L2 samples vertically. The right-above sub-template2460 may include samples located both above the block 2410 and to theright of the block 2410. The right-above sub-template 2460 may havedimensions of M samples horizontally and L2 samples vertically.

FIG. 30 is a diagram of an example of a template 3000 including the leftsub-template 2440, the left-below sub-template 2450, the abovesub-template 2430, and the right-above sub-template 2460. The template3000 may be selected for a block 2410, which may have dimensions of Msamples horizontally and N samples vertically. The above sub-template2430 may include samples located above the block 2410. The abovesub-template 2430 may have dimensions of M samples horizontally and L2samples vertically. The right-above sub-template 2460 may includesamples located above and to the right of the block 2410. Theright-above sub-template 2460 may have dimensions of M sampleshorizontally and L2 samples vertically. The left sub-template 2440 mayinclude samples located to the left of the block 2410. The leftsub-template 2440 may have dimensions of L1 samples horizontally and Nsamples vertically. The left-below sub-template 2450 may include sampleslocated to the left of the block 2410 and below the block 2410. Theleft-below sub-template 2450 may have dimensions of L1 sampleshorizontally and N samples vertically.

FIG. 31 is a diagram of an example of a template 3100 including theleft-above sub-template 2420, the left sub-template 2440, the left-belowsub-template 2450, the above sub-template 2430, and the right-abovesub-template 2460. The template 3100 may be selected for a block 2410,which may have dimensions of M samples horizontally and N samplesvertically. The left-above sub-template 2420 may include samples locatedto the left and above the block 2410. The left-above sub-template 2420may have dimensions of L1 samples horizontally and L2 samplesvertically. The above sub-template 2430 may include samples locatedabove the block 2410. The above sub-template 2430 may have dimensions ofM samples horizontally and L2 samples vertically. The right-abovesub-template 2460 may include samples located above and to the right ofthe block 2410. The right-above sub-template 2460 may have dimensions ofM samples horizontally and L2 samples vertically. The left sub-template2440 may include samples located to the left of the block 2410. The leftsub-template 2440 may have dimensions of L1 samples horizontally and Nsamples vertically. The left-below sub-template 2450 may include sampleslocated to the left of and below the block 2410. The left-belowsub-template 2450 may have dimensions of L1 samples horizontally and Nsamples vertically.

FIG. 32 is a diagram of an example of a template 3200 including aleft-above sub-template 2420, a left sub-template 2440, a left-belowsub-template 2450, an above sub-template 2430, and a right-abovesub-template 2460 that are spaced apart from a block. The exampletemplate 3200 may be selected for a block 2410, which may havedimensions of M samples horizontally and N samples vertically. Incontrast to the sub-templates in FIGS. 24-31, the sub-templates in FIG.32 may be spaced apart from the block 2410. For example, the left-abovesub-template 2420, the left sub-template 2440, and the left-belowsub-template 2450 may be spaced horizontally apart from the block 2410by a gap 3220. The gap 3220 may have a horizontal dimension of L3samples. The left-above sub-template 2420, the above sub-template 2430,and the right-above sub-template 2460 may be spaced vertically apartfrom the block 2410 by a gap 3210. The gap 3210 may have a verticaldimension of L4 samples. In an aspect, each of the sub-templates 2420,2430, 2440, 2450, 2460 may have dimensions that are the same as acorresponding sub-template 2420, 2430, 2440, 2450, 2460 in FIGS. 24-31.Accordingly, in FIG. 32, the locations of the sub-templates 2420, 2430,2440, 2450, 2460 are different, but the size of the sub-templates 2420,2430, 2440, 2450, 2460 may be the same as in FIGS. 24-31.

FIG. 33 is a diagram of examples of template-reference samples 3310 fora template 3300 including a left-above sub-template 2420, a leftsub-template 2440, and an above sub-template 2430. The example template3300 may be selected for a block 2410, which may have dimensions of Msamples horizontally and N samples vertically. The left-abovesub-template 2420 may include samples located to the left and above theblock 2410. The left-above sub-template 2420 may have dimensions of L1samples horizontally and L2 samples vertically. The above sub-template2430 may include samples located above the block 2410. The abovesub-template 2430 may have dimensions of M samples horizontally and L2samples vertically. The left sub-template 2440 may include sampleslocated to the left of the block 2410. The left sub-template 2440 mayhave dimensions of L1 samples horizontally and N samples vertically. Thetemplate-reference samples 3310 may be a single row of samples locatedabove the template 3300 and a single column of samples located to theleft of the template 3300. The row of samples may have a length of2(L1+M)+1. The column of samples may have a height of 2(L2+N)+1.

FIG. 34 is a diagram of example template-reference samples 3410 for thetemplate 2500 including the left sub-template 2440 and the abovesub-template 2430. The example template 2500 may be selected for a block2410, which may have dimensions of M samples horizontally and N samplesvertically. The above sub-template 2430 may include samples locatedabove the block 2410. The above sub-template 2430 may have dimensions ofM samples horizontally and L2 samples vertically. The left sub-template2440 may include samples located to the left of the block 2410. The leftsub-template 2440 may have dimensions of L1 samples horizontally and Nsamples vertically. The template-reference samples may include one ormore lines (e.g., rows or columns) of samples. For example, thetemplate-reference samples 3410 may include a single row of sampleslocated above the template 2500 and a single column of samples locatedto the left of the template 2500. The row of samples may have a lengthof 2(L1+M)+1. The column of samples may have a height of 2(L2+N)+1.

FIG. 35 is a diagram of example template-reference samples 3510 for thetemplate 2600 including the above sub-template 2430. Thetemplate-reference samples 3510 may be a single row of samples locatedabove the template 2600 and a single column of samples located to theleft of the template 2600. The row of samples may have a length of 2M+1.The column of samples may have a height of 2(L2+N)+1.

FIG. 36 is a diagram of example template-reference samples 3610 for thetemplate 2700 including the left sub-template 2440. Thetemplate-reference samples 3610 may be a single row of samples locatedabove the template 2700 and a single column of samples located to theleft of the template 2700. The row of samples may have a length of2(L1+M)+1. The column of samples may have a height of 2N+1.

FIG. 37 is a diagram of example template-reference samples 3710 for thetemplate 2600 including the above sub-template 2430. Thetemplate-reference samples 3710 may be a single row of samples locatedabove the template 2600 and a single column of samples located to theleft of the template 2600. The row of samples may have a length of2(L1+M)+1. The column of samples may have a height of 2(L2+N)+1. Becausethe template 2600 does not include the left-above sub-template 2420 orthe left sub-template 2440, the column of samples may be spaced from thetemplate 2600 by a horizontal gap 3720 with a width of L1.

FIG. 38 is a diagram of example template-reference samples 3810 for thetemplate 2700 including the left sub-template 2440. Thetemplate-reference samples 3810 may be a single row of samples locatedabove the template 2700 and a single column of samples located to theleft of the template 2700. The row of samples may have a length of2(L1+M)+1. The column of samples may have a height of 2(L2+N)+1. Becausethe template 2700 does not include the left-above sub-template 2420 orthe above sub-template 2430, the row of samples may be spaced from thetemplate 2700 by a vertical gap 3820 with a height of L2.

FIG. 39 is a diagram of example template-reference samples 3910 for thetemplate 2500 including the above sub-template 2430 and the leftsub-template 2440. The template-reference samples 3910 may include asingle column of samples located to the left of the template 2500. Thecolumn of samples may have a height of 2(L2+N)+1. Instead of a singlerow of template-reference samples, a portion 3920 of the row may bemoved to a second row 3930 that is adjacent the left sub-template 2440.The portion 3920 may include L1 samples. The remaining portion in thefirst row may have a length of 2M+L1+1. In an aspect, selectingtemplate-reference samples that are adjacent a sub-template includedwithin the template may improve the prediction of the template.

FIG. 40 is a diagram of example template-reference samples 4010 for thetemplate 2500 including the above sub-template 2430 and the leftsub-template 2440. The template-reference samples 4010 may include asingle row of samples located above the template 2500. The row ofsamples may have a length of 2(L1+M)+1. Instead of a single column oftemplate-reference samples, a portion 4020 of the column may be moved toa second row 4030 that is adjacent the above sub-template 2430. Theportion 4020 may include L2 samples. The remaining portion in the firstcolumn may have a height of 2N+L2+1. In an aspect, selectingtemplate-reference samples that are adjacent a sub-template includedwithin the template may improve the prediction of the template. Inanother aspect, both of the portion 3920 and the portion 4020 may bemoved to the second row 3930 and the second row 4030, respectively.

FIG. 41 illustrates an example of a system 4100 for performing videodecoding. In an aspect, decoding component 4110 can include at least oneof a bitstream receiving component 4112 for receiving an encodedbitstream of one or more images or multiple images in a video, an IPMderiving component 4114 for deriving multiple IPMs for a given block orother portion of an image, a final predictor component 4116 fordetermining a final predictor for decoding the block or other portion ofthe image based on the multiple IPMs. In an example, decoding component4110 may also optionally include a MPM list component 4118 forgenerating an MPM list of IPMs to use in decoding the current block orsubsequent blocks of the image based on the final predictor.

FIG. 42 illustrates an example of a system 4200 for performing videoencoding. In an aspect, encoding component 4210 can include at least oneof a video receiving component 4212 for receiving one or more images ormultiple images in a video, an IPM deriving component 4214 for derivingmultiple IPMs for a given block or other portion of an image, a finalpredictor component 4216 for determining a final predictor for encodingthe block or other portion of the image based on the multiple IPMs. Inan example, encoding component 4210 may also optionally include a MPMlist component 4218 for generating an MPM list of IPMs to use inencoding the current block or subsequent blocks of the image based onthe final predictor.

FIG. 43 illustrates an example of a method 4300 for performing videoencoding or decoding based on multiple IPMs. Referring to FIGS. 41-43,in operation, computing device 4102 or 4202 may perform a method 4300 ofvideo encoding or decoding, by such as via execution of a decodingcomponent 4110 by a processor 4104 and/or memory 4106, an encodingcomponent 4210 by a processor 4204 and/or memory 4206, and/or based onprocessor-executable instructions stored in memory 4106 or 4206. Forexample, decoding component 4110 can be part of or can include a videodecoder 124, video decoder 300, or HEVC video encoder and decoder 400,as described above, and/or encoding component 4210 can be part of or caninclude a video encoder 114, video encoder 200, or HEVC video encoderand decoder 400, as described above.

Referring to FIG. 43, in method 4300, optionally at action 4302, a videoor a bitstream of a video can be received. In an aspect, bitstreamreceiving component 4112, e.g., in conjunction with processor 4104,memory 4106, decoding component 4110, etc., can receive the bitstream ofthe video, which can include encoded bitstream 4146. For example,bitstream receiving component 4112 can receive the encoded bitstream4146 from another computing device or other device or source, which canhave encoded the bitstream using one or more video coding techniques,such as HEVC, VVC, etc. In an example, the encoded bitstream 4146 caninclude the image and/or can include one or more other images as part ofa video for display on a display device or otherwise for decoding bydecoding component 4110 and/or computing device 4102. In an example,decoding component 4110 can decode the encoded bitstream 4146, asdescried above and further herein, to generate a plurality of videoframes 4142 for display or storage.

In another aspect, video receiving component 4212, e.g., in conjunctionwith processor 4204, memory 4206, encoding component 4210, etc., canreceive the video, which can include the plurality of video frames 4242.For example, video receiving component 4212 can receive the plurality ofvideo frames 4242 from another computing device or other device orsource for encoding. In an example, the plurality of video frames 4242can include the image and/or can include one or more other images aspart of a video for display on a display device or otherwise forencoding by encoding component 4210 and/or computing device 4202. In anexample, encoding component 4210 can encode the plurality of videoframes 4242, as descried above and further herein, to generate anencoded bitstream 4246 for decoding by another device or at anothertime.

In method 4300, at action 4304, during conversion between a currentvideo block of a video and a bistream of the video, at least onetemplate set for the current video block can be constructed from aplurality of sub-templates. In an aspect, decoding component 4110, e.g.,in conjunction with processor 4104, memory 4106, etc., or encodingcomponent 4210, e.g., in conjunction with processor 4204, memory 4206,etc., can construct, during conversion between a current video block ofthe video and the bitstream of the video, at least one template set forthe current video block from a plurality of sub-templates. For example,decoding component 4110 can construct the at least one template setduring conversion between the bitstream of the video and the currentvideo block of the video in decoding the bitstream of the video into thecurrent video block of the video. In another example, encoding component4210 can construct the at least one template set during conversionbetween the current video block of the video and the bitstream of thevideo in encoding the the current video block of the video into thebitstream of the video. For example, decoding component 4110 or encodingcomponent 4210 can construct the template set to include one or more ofa left sub-template, an above sub-template, an above right sub-template,a left below sub-template, and a left above sub-template, as describedabove, for the current video block or the b.

In method 4300, at action 4306, multiple IPMs can be derived based oncost calculations. In an aspect, IPM deriving component 4114, e.g., inconjunction with processor 4104, memory 4106, decoding component 4110,etc., or IPM deriving component 4214, e.g., in conjunction withprocessor 4204, memory 4206, encoding component 4210, etc., can derivethe multiple IPMs based on the cost calculations. For example, IPMderiving component 4114 can determine the multiple IPMs to use indecoding the block, or IPM deriving component 4214 can determine themultiple IPMs to use in encoding the block, based on one or moremechanisms used in conventional IPM derivation, as described above. Inthis regard, for example, the multiple IPMs can be conventional IPMsfrom a conventional IPM derivation process, such as one of the 67 IPMsin VCC described above.

In an example, IPM deriving component 4114 or 4214 can derive multiple(e.g., two or more IPMs) based on determining which IPMs have a smallestcost (e.g., a smallest cost calculated between predicted samples ofblocks and reconstructed samples of blocks, as described). For example,IPM deriving component 4114 or 4214 can derive a number (positiveinteger), K, of IPMs where K>1. In one example, IPM deriving component4114 or 4214 can derive a certain number of K smallest cost IPMs, deriveany number of IPMs having cost less than a threshold, derive any numberof IPMs within a threshold cost difference of a smallest cost IPM, etc.In one example, the multiple IPMs can represent IPMs that can be used todecode (or encode) the block, and decoding component 4110 can decode (orencoding component 4210 can encode) the block using a final predictorthat is one of the multiple IPMs or computed based on the multiple IPMs.

For example, instead of deriving one IPM, aspects described hereinrelate to deriving two or more IPMs. Suppose the number of the derivedIPMs as K, K is an integer and K is larger than 1. In one example, IPMderiving component 4114 or 4214 can derive the K IPMs by using the sametemplates, as described above. For example, IPM deriving component 4114or 4214 can derive the K IPMs with smallest costs where a cost iscalculated between the predicted samples and the reconstructed samplesof the template for a IPM in the given IPM candidate set. In oneexample, IPM deriving component 4114 or 4214 can derive the K IPMs usingdifferent templates. For example, where the ith IPMs are derived fromith template sets, where i=1, 2, . . . , K and a template set may becomposed of one or more of Template-L, Template-A, Template-RA,Template-LB, or Template-LA, for any two different number i and j from 1to K, the templates in the ith template set can be different thetemplates in the jth template set. In another example, the templates inthe ith template set may be same as the templates in the jth templateset where i,j=1, 2, . . . , K and i is not equal to j. In one example,there may be at least two different template sets whose templates aredifferent. In one example, IPM deriving component 4114 or 4214 canderive two or more IPMs from a same template set and can derive otherIPMs from one or more different template sets.

In method 4300, at action 4308, a final predictor of the current videoblock can be determined based on the multiple IPMs. In an aspect, finalpredictor component 4116, e.g., in conjunction with processor 4104,memory 4106, decoding component 4110, etc., or final predictor component4216, e.g., in conjunction with processor 4204, memory 4206, encodingcomponent 4210, etc., can determine, based on the multiple IPMs, thefinal predictor of the current video block. For example, final predictorcomponent 4116 or 4216 can determine the final predictor to be one ofthe multiple IPMs, which may be conventional IPMs, as described, or cangenerate or calculate the final predictor based on the multiple IPMs,which may be conventional IPMs, as described.

In one example, which one of the derived K IPMs is used for currentblock may be signaled with a syntax element. Thus, in method 4300,optionally at action 4310, a syntax element for determining the finalpredictor based on multiple IPMs can be received. In an aspect, finalpredictor component 4116, e.g., in conjunction with processor 4104,memory 4106, decoding component 4110, etc., or final predictor component4216, e.g., in conjunction with processor 4204, memory 4206, encodingcomponent 4210, etc., can receive (e.g., in the bitstream or associatedassistance information, metadata, etc.) the syntax element fordetermining the final predictor based on the multiple IPMs. In thisexample, final predictor component 4116 or 4216 can determine the syntaxelement from information received with the encoded bitstream 4146 (or tobe included with encoded bitstream 4246) or with assistance informationreceived with the encoded bitstream 4146 (or to be included with encodedbitstream 4246), where the syntax element can indicate which of multiplederived IPMs to use in decoding, or used in encoding, the block (e.g.,indicated as an index of the multiple derived IPMs or other instructionsfor determining an IPM from the multiple IPMs).

In one example, the syntax element may be binarized with fixed lengthcoding, or truncated unary coding, or unary coding, or EGk coding, orcoded as a flag. In one example, the syntax element may be bypass coded.Thus, for example, final predictor component 4216 can encode the syntaxelement to indicate which of the multiple IPMs to use as the finalpredictor, or final predictor component 4116 can decode or interpret thesyntax element to determine which of the multiple IPMs to use as thefinal predictor. Alternatively, in one example, the syntax element maybe context coded. In any case, the coded syntax element may be part ofthe encoded bitstream 4146 or 4246 or other information and/or can beindicated in such a way to convey one or more blocks of the image towhich the syntax element relates. In one example, a mechanism used tosignal the syntax element may depend on the decoded (or encoded)information, such as block dimension of the block of the image (e.g., anumber of pixels in a vertical and horizontal direction), block shape ofthe block of the image (e.g., square or rectangular), slice/picture typeof a slice of the image (e.g., I-slice, B-slice, or P-slice), etc.

In another example, which one of the derived K IPMs is used for currentblock may be implicitly derived. In one example, final predictorcomponent 4116 or 4216 can implicitly derive the final predictor basedon decoded information such as block shape of the block of the image(e.g., square or rectangular). Suppose the block width and height of theblock of the image as BW and BH; for example, IPM deriving component4114 or 4214 can derive IPM A from Template-L and IPM B from Template-A.In this example, final predictor component 4116 or 4216 can use IPM A asthe final predictor when BW is less than or equal to BH or can use IPM Bas the final predictor when BW is larger than BH.

In another example, final predictor component 4116 or 4216 can use morethan one IPM (denoted as H) from the derived K IPMs in the current blockand the final predictor of current block may be generated using Hpredictors derived using these H IPMs. In one example, based on thederived IPMs, which may be conventional IPMs, final predictor component4116 or 4216 can determine a weighted summed (combined) of the Hpredictors, which may be used to derive the final predictor for thecurrent block, where H is an integer and larger than 1. In one example,H=2 or H=3. In another example, final predictor component 4116 or 4216can determine the final predictor for the current block using one ormore IPM from H IPMs and one or more default IPMs, where the default IPMmay be any IPM, such as the planar, DC, horizontal mode, vertical mode,diagonal top-right mode, diagonal bottom-left mode, diagonal top-leftmode, etc. In one example, the default IPMs may be signaled with asyntax element, as described above. In one example, final predictorcomponent 4116 or 4216 can determine the final predictor of currentblock from one or more default IPMs alone. In one example, finalpredictor component 4116 or 4216 can determine any weights for derivingthe final predictor of current block based on block dimension, blockshape, numbers of the template, etc.

In method 4300, at action 4312, the conversion can be performed based onthe final predictor. In an aspect, decoding component 4110, e.g., inconjunction with processor 4104, memory 4106, etc., can perform theconversion based on the final predictor. As described, for example,decoding component 4110 can decode the bitstream of the video into thecurrent video block of the video based on the final predictor. In oneexample, decoding component 4110 can use DIMD or other suitable videodecoding processes to decode blocks of the image based on an IPM ordetermined final predictor determined based on neighboring reconstructedsamples of a current block in this regard. In another aspect, encodingcomponent 4210, e.g., in conjunction with processor 4204, memory 4206,etc., can perform the conversion based on the final predictor. Asdescribed, for example, encoding component 4210 can encode the currentvideo block of the video into the encoded bitstream of the video basedon the final predictor. In one example, decoding component 4110 can useHEVC, VVC, or other suitable video encoding processes to encode blocksof the video based on an IPM or determined final predictor determinedbased on neighboring reconstructed samples of a current block in thisregard. In additional examples, the final predictor may be used with anMPM list in decoding (or encoding) a current or subsequent block. Thedecoded blocks can be used to produce the plurality of video frames4142, or the encoded blocks can be used to produce encoded bitstream4246.

In one example, in method 4300, optionally at action 4314, a MPM listfor a subsequent block can be generated based on the final predictor. Inan aspect, final predictor component 4116, e.g., in conjunction withprocessor 4104, memory 4106, decoding component 4110, etc., can generatethe MPM list for the subsequent block based on the final predictor, anddecoding component 4110 can use the MPM list in decoding the subsequentblock, as described above and further herein. In another aspect, finalpredictor component 4216, e.g., in conjunction with processor 4204,memory 4206, encoding component 4210, etc., can generate the MPM listfor the subsequent block based on the final predictor, and encodingcomponent 4210 can use the MPM list in encoding the subsequent block, asdescribed above and further herein. For example, final predictorcomponent 4116 or 4216 can determine to include the final predictor inthe MPM list, where the MPM list may not include the final predictor. Inanother example, final predictor component 4116 or 4216 can determine aconventional IPM to include the MPM list based on the final predictor.

For example, final predictor component 4116 or 4216 can use the finalpredictor in the derivation of MPM list construction when parsing thesubsequent blocks in decoding (or encoding) order. In one example, thefinal predictor may be regarded as a conventional IPM and used in thederivation of MPM list when the final predictor is one of theconventional IPM candidate set. For example, when the conventional IPMcandidate set consist of X IPMs (e.g., 67 IPMs in VVC) and the finalpredictor is one of X IPMs, final predictor component 4116 or 4216 canuse the final predictor directly to construct the MPM list same as theMPM list construction in VVC. Alternatively, for example, when the finalpredictor is not one of the conventional IPM candidate set, finalpredictor component 4116 or 4216 can convert the final predictor to oneof the conventional IPMs and used in the derivation of MPM list.Alternatively, for example, final predictor component 4116 or 4216 maynot use the final predictor in the derivation of MPM list.

In another example, final predictor component 4116 or 4216 can replacethe final predictor by a pre-defined IPM (e.g., mode Y) in thederivation of MPM list when parsing the subsequent blocks in decodingorder. In one example, mode Y may be DC, Planar, horizontal degree mode,vertical degree mode, diagonal top-right degree mode, diagonalbottom-left mode, diagonal top-left mode, etc. In one example, whetherfinal predictor component 4116 or 4216 uses the final predictor or notin the derivation of MPM list may depend on the decoded information suchas slice/picture type, or indicated by a signaled syntax element, etc.In one example, final predictor component 4116 or 4216 can use the finalpredictor in the derivation of MPM list for I-slice, or may not use thefinal predictor in the derivation of MPM list for PB slices.

In one example, in determining the final predictor at action 4308,optionally at action 4316, the final predictor can be determined basedadditionally on an MPM list. In an aspect, final predictor component4116, e.g., in conjunction with processor 4104, memory 4106, decodingcomponent 4110, etc., or final predictor component 4216, e.g., inconjunction with processor 4204, memory 4206, encoding component 4210,etc., can determine the final predictor based additionally on an MPMlist. For example, given an MPM list for the current block, asdescribed, above, final predictor component 4116 or 4216 can use thefinal predictor derived from the multiple IPMs in determining to use thefinal predictor based on an MPM list or one of the conventional IPMs inthe MPM list. For example, as described in further detail below, it maybe possible that the MPM list includes the final predictor, whether ornot the final predictor is a conventional IPM. In this example, finalpredictor component 4116 or 4216 can determine to use the finalpredictor for the block (e.g., for decoding or encoding the block) basedon the MPM list. In other examples, final predictor component 4116 or4216 can use the final predictor determined from the multiple IPMs toselect an IPM from the MPM list as the final predictor to use for theblock (e.g., for decoding or encoding the block).

In an example, final predictor component 4116 or 4216 can use the finalpredictor to construct the MPM list of the current block. In oneexample, the derived IPM may be treated as an MPM and final predictorcomponent 4116 or 4216 can insert the final predictor into the MPM list.In one example, final predictor component 4116 or 4216 can add the finalpredictor to the MPM list and before all other MPMs in the MPM list(e.g., at the beginning of the list) constructed using the conventionalMPM list construction described above. Alternatively, furthermore, finalpredictor component 4116 or 4216 can increase the MPM list size by 1 toadd the final predictor. In one example, final predictor component 4116or 4216 can add the final predictor to the MPM list and after all otherMPMs in the MPM list (e.g., at the end of the list) constructed usingthe conventional MPM list construction described above. Alternatively,furthermore, final predictor component 4116 or 4216 can increase the MPMlist size by 1 to add the final predictor. In one example, finalpredictor component 4116 or 4216 can add the final predictor to replaceone MPM in the MPM list constructed using the conventional MPM listconstruction described above. Alternatively, furthermore, the MPM listsize may be kept unchanged.

In one example, final predictor component 4116 or 4216 may not add thefinal predictor to the MPM list, and instead may use the final predictorto reorder the remaining IPMs excluding MPMs. In one example, finalpredictor component 4116 or 4216 can regard the final predictor as aconventional IPM and may use the final predictor in the derivation ofMPM list when the derived IPM is one of the conventional IPM candidateset. In one example, when the conventional IPM candidate set consist ofX IPMs (i.e., 67 IPMs in VVC) and the final predictor is one of X IPMs,final predictor component 4116 or 4216 can directly use the finalpredictor to construct the MPM list same or similar as the MPM listconstruction in VVC. Alternatively, when the derived IPM is not one ofthe conventional IPM candidate set, final predictor component 4116 or4216 can convert the final predictor to one of the conventional IPMs anduse the conventional IPM in the derivation of MPM list.

In various examples, the disclosed methods above may be signaled atsequence level, picture level, slice level, tile group level, such as insequence header, picture header, SPS, VPS, DPS, DCI, PPS, APS, sliceheader, tile group header, etc. In other various examples, the disclosedmethods above may be signaled at PU, TU, CU, VPDU, CTU, CTU row, slice,tile, sub-picture, etc. In other various examples, the disclosed methodsabove may be dependent on coded information, such as block size, colorformat, single/dual tree partitioning, colour component, slice/picturetype, etc.

While the foregoing disclosure discusses illustrative aspects and/orembodiments, it should be noted that various changes and modificationscould be made herein without departing from the scope of the describedaspects and/or embodiments as defined by the appended claims.Furthermore, although elements of the described aspects and/orembodiments may be described or claimed in the singular, the plural iscontemplated unless limitation to the singular is explicitly stated.Additionally, all or a portion of any aspect and/or embodiment may beutilized with all or a portion of any other aspect and/or embodiment,unless stated otherwise.

The previous description is provided to enable any person havingordinary skill in the art to practice the various aspects describedherein. Various modifications to these aspects will be readily apparentto a person having ordinary skill in the art, and the generic principlesdefined herein may be applied to other aspects. The claims are notintended to be limited to the aspects shown herein, but is to beaccorded the full scope consistent with the language claims, wherereference to an element in the singular is not intended to mean “one andonly one” unless specifically so stated, but rather “one or more.”Unless specifically stated otherwise, the term “some” refers to one ormore. Combinations such as “at least one of A, B, or C,” “one or more ofA, B, or C,” “at least one of A, B, and C,” “one or more of A, B, andC,” and “A, B, C, or any combination thereof” include any combination ofA, B, or C, and may include multiples of A, multiples of B, or multiplesof C. Specifically, combinations such as “at least one of A, B, or C,”“one or more of A, B, or C,” “at least one of A, B, and C,” “one or moreof A, B, and C,” and “A, B, C, or any combination thereof” may be Aonly, B only, C only, A and B, A and C, B and C, or A and B and C, whereany such combinations may contain one or more member or members of A, B,or C. All structural and functional equivalents to the elements of thevarious aspects described throughout this disclosure that are known orlater come to be known to a person having ordinary skill in the art areexpressly incorporated herein by reference and are intended to beencompassed by the claims. Moreover, nothing disclosed herein isintended to be dedicated to the public regardless of whether suchdisclosure is explicitly recited in the claims. The words “module,”“mechanism,” “element,” “device,” and the like may not be a substitutefor the word “means.” As such, no claim element is to be construed as ameans plus function unless the element is expressly recited using thephrase “means for.”

The following clauses describes some embodiments and techniques.

1. A method of processing video data, comprising:

constructing, during a conversion between a current video block of avideo and a bitstream of the video, at least one template set for thecurrent video block from a plurality of sub-templates;

deriving multiple intra-prediction modes (IPMs) based on costcalculations; determining, based on the multiple IPMs, a final predictorof the current video block; and performing the conversion based on thefinal predictor;

wherein the plurality of sub-templates includes a left sub-template, anabove sub-template, an above right sub-template, a left belowsub-template, and a left above sub-template.

2. The method of clause 1, wherein deriving the multiple IPMs includesderiving at least two IPMs for the current video block based on a sametemplate set.

3. The method of clause 2, wherein deriving the multiple IPMs includesderiving the at least two IPMs for the current video block based ondetermining that the at least two IPMs have a smallest cost of a set ofpossible IPMs for the current video block.

4. The method of clause 1, wherein deriving the multiple IPMs includesderiving at least one IPMs for the current video block based on a firsttemplate set and deriving other IPMs for the current video block basedon at least one template set different from the first template sets.

5. The method of clause 1, wherein determining the final predictorincludes determining one of the multiple IPMs as a final IPM todetermine the final predictor.

6. The method of clause 5, wherein determining the final predictorfurther includes determining a syntax element related to the final IPMis present in the bitstream of the video, and wherein the syntax elementis binarized with fixed length coding, or truncated unary coding, orunary coding, or EG coding, or coded as a flag.

7. The method of clause 6, wherein the syntax element is bypass coded orcontext coded.

8. The method of clause 6, wherein determining a syntax element relatedto the final IPM is present in the bitstream is further based on atleast one of a block dimension of the current video block, block shapeof the current video block, or a slice type corresponding to a slice ofthe current video block.

9. The method of clause 5, wherein determining the one of the multipleIPMs as the final IPM is based on at least one of a block dimension ofthe current video block, block shape of the current video block, or aslice type corresponding to a slice of the current video block.

10. The method of clause 9, wherein determining the one of the multipleIPMs as the final IPM includes determining a first one of the multipleIPMs when a width of the current video block is less than or equal to aheight of the current video block or determining a second one of themultiple IPMs when the width of the current video block is greater thanthe height of the current video block.

11. The method of clause 1, wherein determining the final predictorincludes selecting H IPMs from the multiple IPMs to generate Hintermediate predictors, wherein H is greater than one.

12. The method of clause 11, wherein generating the final predictorfurther includes performing a weighted sum of the H intermediatepredictors.

13. The method of clause 12, further comprising determining one or moreweights for performing the weighted sum based on at least one of a blockdimension of the current video block, block shape of the current videoblock, or numbers of a sub-template.

14. The method of clause 1, wherein generating the final predictor isbased on at least one of the multiple IPMs or one or more default IPMs.

15. The method of clause 14, wherein the one or more default IPMsinclude at least one of a planar mode, a DC mode, a horizontal mode, avertical mode, a diagonal top-right mode, a diagonal bottom-left mode,or a diagonal top-left mode.

16. The method of clause 14, further comprising determining a syntaxelement related to the one or more default IPMs is presented in thebitstream.

17. The method of clause 1, wherein the conversion includes decoding thecurrent video block from the bitstream.

18. The method of clause 1, wherein the conversion includes encoding thecurrent video block into the bitstream.

19. An apparatus for processing video data comprising a processor and anon-transitory memory with instructions thereon, wherein theinstructions upon execution by the processor, cause the processor to:

construct, during a conversion between a current video block of a videoand a bitstream of the video, at least one template set for the currentvideo block from a plurality of sub-templates;

derive multiple intra-prediction modes (IPMs) based on costcalculations;

determine, based on the multiple IPMs, a final predictor of the currentvideo block; and perform the conversion based on the final predictor;

wherein the plurality of sub-templates includes a left sub-template, anabove sub-template, an above right sub-template, a left belowsub-template, and a left above sub-template.

20. A non-transitory computer-readable recording medium storing abitstream of a video which is generated by a method performed by a videoprocessing apparatus, wherein the method comprises:

constructing, during a conversion between a current video block of avideo and a bitstream of the video, at least one template set for thecurrent video block from a plurality of sub-templates;

deriving multiple intra-prediction modes (IPMs) based on costcalculations;

determining, based on the multiple IPMs, a final predictor of thecurrent video block; and generating the bitstream from the current blockbased on the final predictor;

wherein the plurality of sub-templates includes a left sub-template, anabove sub-template, an above right sub-template, a left belowsub-template, and a left above sub-template.

21. A non-transitory computer-readable storage medium storinginstructions that cause a processor to:

construct, during a conversion between a current video block of a videoand a bitstream of the video, at least one template set for the currentvideo block from a plurality of sub-templates;

derive multiple intra-prediction modes (IPMs) based on costcalculations;

determine, based on the multiple IPMs, a final predictor of the currentvideo block; and

perform the conversion based on the final predictor;

wherein the plurality of sub-templates includes a left sub-template, anabove sub-template, an above right sub-template, a left belowsub-template, and a left above sub-template.

22. A method of processing video data, comprising:

constructing, during a conversion between a current video block of avideo and a bitstream of the video, at least one template set for thecurrent video block from a plurality of sub-templates;

deriving at least one intra-prediction mode (IPM) based on costcalculations; and performing the conversion based on the at least oneintra-prediction mode (IPM); constructing, a most probable mode (MPM)list for a subsequent video block after the current video block in thevideo, wherein one or more IPM of the at least one IPM is determined tobe added into the MPM list of the subsequent video block.

23. The method of clause 22, wherein the one or more IPM is addeddirectly into the MPM list in response to the one or more IPM being aconventional intra mode, wherein the conventional intra mode includes anangular mode, a DC mode, and a planar mode.

24. The method of clause 22, wherein the one or more IPM is converted toa conventional intra mode before being added into the MPM list inresponse to the one or more IPM being a non-conventional intra mode,wherein the conventional intra mode includes an angular mode, a DC mode,and a planar mode.

25. The method of clause 22, wherein the one or more IPM is replaced bya defined IPM before being added into the MPM list.

26. The method of clause 25, wherein the defined IPM is at least one ofa planar mode, a DC mode, a horizontal mode, a vertical mode, a diagonaltop-right mode, a diagonal bottom-left mode, or a diagonal top-leftmode.

27. The method of clause 22, wherein one or more IPM of the at least oneIPM is determined to be added into the MPM list of the subsequent videoblock based on a slice type of a slice corresponding to the currentvideo block.

28. The method of clause 27, wherein determining, based on the slicetype is a I slice, one or more IPM of the at least one IPM is determinedto be added into the MPM list of the subsequent video block.

29. The method of clause 27, wherein determining, based on the slicetype is a P slice or a B slice, one or more IPM of the at least one IPMis determined to be not added into the MPM list of the subsequent videoblock.

30. A method of processing video data, comprising:

constructing, during a conversion between a current video block of avideo and a bitstream of the video, at least one template set for thecurrent video block from a plurality of sub-templates;

deriving at least one intra-prediction mode (IPM) based on costcalculations; and constructing, a most probable mode (MPM) list for thecurrent video block, wherein one or more IPM of the at least one IPM isdetermined to be inserted into the MPM list of the current video block;and

performing the conversion based on the MPM list.

31. The method of clause 30, wherein the one or more IPM is inserted atthe beginning of the MPM list.

32. The method of clause 31, further comprising increasing a size of theMPM list by one for the one or more IPM.

33. The method of clause 30, wherein the one or more IPM is inserted atthe end of the MPM list.

0.34. The method of clause 33, further comprising increasing a size ofthe MPM list by one for the one or more IPM.

35. The method of clause 30, wherein the one or more IPM is used toreplace at least one candidate in the MPM list.

36. The method of clause 30, wherein constructing the MPM list includesordering the MPM list based on the one or more IPM.

37. The method of clause 30, wherein constructing the MPM list includesordering the remaining IPMs which are not in MPM list based on the onthe one or more IPM.

38. The method of clause 30, wherein the one or more IPM is addeddirectly into the MPM list in response to the one or more IPM being aconventional intra mode, wherein the conventional intra mode includes anangular mode, a DC mode, and a planar mode.

39. The method of clause 30, wherein the one or more IPM is converted toa conventional intra mode before being added into the MPM list inresponse to the one or more IPM being a non-conventional intra mode,wherein the conventional intra mode includes an angular mode, a DC mode,and a planar mode.

40. An apparatus for processing video data comprising a processor and anon-transitory memory with instructions thereon, wherein theinstructions upon execution by the processor, cause the processor to:

construct, during a conversion between a current video block of a videoand a bitstream of the video, at least one template set for the currentvideo block from a plurality of sub-templates;

derive at least one intra-prediction mode (IPM) based on costcalculations; and

perform the conversion based on the at least one intra-prediction mode(IPM);

construct, a most probable mode (MPM) list for a subsequent video blockafter the current video block in the video, wherein one or more IPM ofthe at least one IPM is determined to be added into the MPM list of thesubsequent video block.

41. A non-transitory computer-readable recording medium storing abitstream of a video which is generated by a method performed by a videoprocessing apparatus, wherein the method comprises:

constructing, during a conversion between a current video block of avideo and a bitstream of the video, at least one template set for thecurrent video block from a plurality of sub-templates;

deriving at least one intra-prediction mode (IPM) based on costcalculations; and performing the conversion based on the at least oneintra-prediction mode (IPM);

constructing, a most probable mode (MPM) list for a subsequent videoblock after the current video block in the video, wherein one or moreIPM of the at least one IPM is determined to be added into the MPM listof the subsequent video block;

generating the bitstream from the current block based on the MPM list.

42. A non-transitory computer-readable storage medium storinginstructions that cause a processor to:

construct, during a conversion between a current video block of a videoand a bitstream of the video, at least one template set for the currentvideo block from a plurality of sub-templates;

derive at least one intra-prediction mode (IPM) based on costcalculations; and

perform the conversion based on the at least one intra-prediction mode(IPM);

construct, a most probable mode (MPM) list for a subsequent video blockafter the current video block in the video, wherein one or more IPM ofthe at least one IPM is determined to be added into the MPM list of thesubsequent video block.

43. An apparatus for processing video data comprising a processor and anon-transitory memory with instructions thereon, wherein theinstructions upon execution by the processor, cause the processor to:

construct, during a conversion between a current video block of a videoand a bitstream of the video, at least one template set for the currentvideo block from a plurality of sub-templates;

derive at least one intra-prediction mode (IPM) based on costcalculations; and

construct, a most probable mode (MPM) list for the current video block,wherein one or more IPM of the at least one IPM is determined to beinserted into the MPM of the current video block; and

perform the conversion based on the MPM list.

44. A non-transitory computer-readable recording medium storing abitstream of a video which is generated by a method performed by a videoprocessing apparatus, wherein the method comprises:

constructing, during a conversion between a current video block of avideo and a bitstream of the video, at least one template set for thecurrent video block from a plurality of sub-templates;

deriving at least one intra-prediction mode (IPM) based on costcalculations; and

constructing, a most probable mode (MPM) list for the current videoblock, wherein one or more IPM of the at least one IPM is determined tobe inserted into the MPM of the current video block; and

generating the bitstream from the current block based on the finalpredictor based on the MPM list.

45. A non-transitory computer-readable storage medium storinginstructions that cause a processor to:

construct, during a conversion between a current video block of a videoand a bitstream of the video, at least one template set for the currentvideo block from a plurality of sub-templates;

derive at least one intra-prediction mode (IPM) based on costcalculations; and

construct, a most probable mode (MPM) list for the current video blockafter the current video block in the video, wherein one or more IPM ofthe at least one IPM is determined to be inserted into the MPM list ofthe current video block; and perform the conversion based on the MPMlist.

What is claimed is:
 1. A method of processing video data, comprising:constructing, during a conversion between a current video block of avideo and a bitstream of the video, at least one template set for thecurrent video block from a plurality of sub-templates; deriving multipleintra-prediction modes (IPMs) based on cost calculations, whereinderiving the multiple IPMs includes deriving the at least two IPMs forthe current video block based on determining that the at least two IPMshave a smallest cost of a set of possible IPMs for the current videoblock; determining, based on the multiple IPMs, a final predictor of thecurrent video block; and performing the conversion based on the finalpredictor; wherein the plurality of sub-templates includes a leftsub-template, an above sub-template, an above right sub-template, a leftbelow sub-template, and a left above sub-template.
 2. The method ofclaim 1, wherein deriving the multiple IPMs includes deriving at leastone IPM for the current video block based on a first template set andderiving other IPMs for the current video block based on at least onetemplate set different from the first template set.
 3. The method ofclaim 1, wherein determining the final predictor includes determiningone of the multiple IPMs as a final IPM to determine the finalpredictor.
 4. The method of claim 3, wherein determining the finalpredictor further includes determining a syntax element related to thefinal IPM is present in the bitstream of the video, and wherein thesyntax element is binarized with fixed length coding, or truncated unarycoding, or unary coding, or EG coding, or coded as a flag.
 5. The methodof claim 4, wherein the syntax element is bypass coded or context coded.6. The method of claim 4, wherein determining a syntax element relatedto the final IPM is present in the bitstream is further based on atleast one of a block dimension of the current video block, block shapeof the current video block, or a slice type corresponding to a slice ofthe current video block.
 7. The method of claim 3, wherein determiningthe one of the multiple IPMs as the final IPM is based on at least oneof a block dimension of the current video block, block shape of thecurrent video block, or a slice type corresponding to a slice of thecurrent video block.
 8. The method of claim 7, wherein determining theone of the multiple IPMs as the final IPM includes determining a firstone of the multiple IPMs when a width of the current video block is lessthan or equal to a height of the current video block or determining asecond one of the multiple IPMs when the width of the current videoblock is greater than the height of the current video block.
 9. Themethod of claim 1, wherein determining the final predictor includesselecting H IPMs from the multiple IPMs to generate H intermediatepredictors, wherein H is greater than one.
 10. The method of claim 9,wherein generating the final predictor further includes performing aweighted sum of the H intermediate predictors.
 11. The method of claim10, further comprising determining one or more weights for performingthe weighted sum based on at least one of a block dimension of thecurrent video block, block shape of the current video block, or numbersof a sub-template.
 12. The method of claim 1, wherein generating thefinal predictor is based on at least one of the multiple IPMs or one ormore default IPMs.
 13. The method of claim 12, wherein the one or moredefault IPMs include at least one of a planar mode, a DC mode, ahorizontal mode, a vertical mode, a diagonal top-right mode, a diagonalbottom-left mode, or a diagonal top-left mode.
 14. The method of claim12, further comprising determining a syntax element related to the oneor more default IPMs is presented in the bitstream.
 15. The method ofclaim 1, wherein the conversion includes decoding the current videoblock from the bitstream.
 16. The method of claim 1, wherein theconversion includes encoding the current video block into the bitstream.17. An apparatus for processing video data comprising a processor and anon-transitory memory with instructions thereon, wherein theinstructions upon execution by the processor, cause the processor to:construct, during a conversion between a current video block of a videoand a bitstream of the video, at least one template set for the currentvideo block from a plurality of sub-templates; derive multipleintra-prediction modes (IPMs) based on cost calculations, wherein the atleast two IPMs are derived for the current video block based ondetermining that the at least two IPMs have a smallest cost of a set ofpossible IPMs for the current video block; determine, based on themultiple IPMs, a final predictor of the current video block; and performthe conversion based on the final predictor; wherein the plurality ofsub-templates includes a left sub-template, an above sub-template, anabove right sub-template, a left below sub-template, and a left abovesub-template.
 18. A non-transitory computer-readable recording mediumstoring a bitstream of a video which is generated by a method performedby a video processing apparatus, wherein the method comprises:constructing, during a conversion between a current video block of avideo and a bitstream of the video, at least one template set for thecurrent video block from a plurality of sub-templates; deriving multipleintra-prediction modes (IPMs) based on cost calculations, wherein the atleast two IPMs are derived for the current video block based ondetermining that the at least two IPMs have a smallest cost of a set ofpossible IPMs for the current video block; determining, based on themultiple IPMs, a final predictor of the current video block; andgenerating the bitstream from the current block based on the finalpredictor; wherein the plurality of sub-templates includes a leftsub-template, an above sub-template, an above right sub-template, a leftbelow sub-template, and a left above sub-template.
 19. A non-transitorycomputer-readable storage medium storing instructions that cause aprocessor to: construct, during a conversion between a current videoblock of a video and a bitstream of the video, at least one template setfor the current video block from a plurality of sub-templates; derivemultiple intra-prediction modes (IPMs) based on cost calculations,wherein the at least two IPMs are derived for the current video blockbased on determining that the at least two IPMs have a smallest cost ofa set of possible IPMs for the current video block; determine, based onthe multiple IPMs, a final predictor of the current video block; andperform the conversion based on the final predictor; wherein theplurality of sub-templates includes a left sub-template, an abovesub-template, an above right sub-template, a left below sub-template,and a left above sub-template.